class DTK::Shell::MessageQueue

Constants

MESSAGE_TYPES

Public Class Methods

new() click to toggle source
# File lib/shell/message_queue.rb, line 29
def initialize
  @queue = {}
  init_or_clear()
end
print_messages() click to toggle source
process_response(response_obj) click to toggle source
# File lib/shell/message_queue.rb, line 34
def self.process_response(response_obj)
  self.instance.process_response(response_obj)
end

Public Instance Methods

init_or_clear() click to toggle source
# File lib/shell/message_queue.rb, line 42
def init_or_clear()
  MESSAGE_TYPES.each { |msg_type| @queue[msg_type] = [] }
end
print_messages() click to toggle source
process_response(response_obj) click to toggle source
# File lib/shell/message_queue.rb, line 54
def process_response(response_obj)
  MESSAGE_TYPES.each do |msg_type|
    msg = response_obj[msg_type.to_s] || response_obj[msg_type]
    @queue[msg_type] << msg if msg
  end
end