Class: JSCommander::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/jscmd/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body = nil, attributes = {}) ⇒ Message

Returns a new instance of Message.



35
36
37
38
39
40
41
# File 'lib/jscmd/message.rb', line 35

def initialize(body = nil, attributes = {})
  @body = body
  @attributes = {}
  attributes.each do |key, value|
    @attributes[key.to_s] = value
  end
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



33
34
35
# File 'lib/jscmd/message.rb', line 33

def attributes
  @attributes
end

#bodyObject

Returns the value of attribute body.



33
34
35
# File 'lib/jscmd/message.rb', line 33

def body
  @body
end