Class: Juggernaut::Message
- Inherits:
-
Object
- Object
- Juggernaut::Message
- Defined in:
- lib/juggernaut/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#signature ⇒ Object
Returns the value of attribute signature.
Instance Method Summary collapse
-
#initialize(id, body, signature) ⇒ Message
constructor
A new instance of Message.
- #to_s ⇒ Object
Constructor Details
#initialize(id, body, signature) ⇒ Message
Returns a new instance of Message.
8 9 10 11 12 13 |
# File 'lib/juggernaut/message.rb', line 8 def initialize(id, body, signature) @id = id @body = body @signature = signature @created_at = Time.now end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/juggernaut/message.rb', line 5 def body @body end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/juggernaut/message.rb', line 6 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/juggernaut/message.rb', line 3 def id @id end |
#signature ⇒ Object
Returns the value of attribute signature.
4 5 6 |
# File 'lib/juggernaut/message.rb', line 4 def signature @signature end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/juggernaut/message.rb', line 15 def to_s { :id => @id.to_s, :body => @body, :signature => @signature }.to_json end |