Class: NPR::Message

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

Direct Known Subclasses

Warning

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_id, body, raw_message) ⇒ Message

Returns a new instance of Message.



5
6
7
# File 'lib/rubynpr/message.rb', line 5

def initialize(message_id, body, raw_message)
  @body, @message_id, @raw_message = body, message_id, raw_message
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/rubynpr/message.rb', line 3

def body
  @body
end

#message_idObject

Returns the value of attribute message_id.



3
4
5
# File 'lib/rubynpr/message.rb', line 3

def message_id
  @message_id
end

#raw_messageObject

Returns the value of attribute raw_message.



3
4
5
# File 'lib/rubynpr/message.rb', line 3

def raw_message
  @raw_message
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/rubynpr/message.rb', line 9

def to_s
  "#{ self.class } (#{ message_id }): #{ @body }"
end