Class: Remq::Message
- Inherits:
-
Struct
- Object
- Struct
- Remq::Message
- Defined in:
- lib/remq.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
6 7 8 |
# File 'lib/remq.rb', line 6 def body @body end |
#channel ⇒ Object
Returns the value of attribute channel
6 7 8 |
# File 'lib/remq.rb', line 6 def channel @channel end |
#id ⇒ Object
Returns the value of attribute id
6 7 8 |
# File 'lib/remq.rb', line 6 def id @id end |
Class Method Details
.parse(raw) ⇒ Object
8 9 10 11 12 |
# File 'lib/remq.rb', line 8 def Message.parse(raw) header, body = raw.split("\n", 2) channel, id = header.split('@', 2) new(channel, id.to_i, body) end |