Class: Gnip::SystemMessage
- Defined in:
- lib/gnip_api/gnip/system_message.rb
Constant Summary
Constants inherited from Message
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#message_type ⇒ Object
readonly
Returns the value of attribute message_type.
-
#sent ⇒ Object
readonly
Returns the value of attribute sent.
Instance Method Summary collapse
-
#initialize(params) ⇒ SystemMessage
constructor
A new instance of SystemMessage.
- #log_method ⇒ Object
- #original_attributes ⇒ Object
- #to_json ⇒ Object
Methods inherited from Message
#activity?, build, #error?, #generate_json, #info?, #system_message?, #warn?
Constructor Details
#initialize(params) ⇒ SystemMessage
Returns a new instance of SystemMessage.
5 6 7 8 9 10 |
# File 'lib/gnip_api/gnip/system_message.rb', line 5 def initialize params @raw = params @message_type = params.keys.first @message = params['message'] @sent = params['sent'] end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/gnip_api/gnip/system_message.rb', line 3 def @message end |
#message_type ⇒ Object (readonly)
Returns the value of attribute message_type.
3 4 5 |
# File 'lib/gnip_api/gnip/system_message.rb', line 3 def @message_type end |
#sent ⇒ Object (readonly)
Returns the value of attribute sent.
3 4 5 |
# File 'lib/gnip_api/gnip/system_message.rb', line 3 def sent @sent end |
Instance Method Details
#log_method ⇒ Object
19 20 21 |
# File 'lib/gnip_api/gnip/system_message.rb', line 19 def log_method @message_type.to_sym end |
#original_attributes ⇒ Object
12 13 14 15 16 17 |
# File 'lib/gnip_api/gnip/system_message.rb', line 12 def original_attributes { @message_type => @message, :sent => @sent } end |
#to_json ⇒ Object
27 28 29 |
# File 'lib/gnip_api/gnip/system_message.rb', line 27 def to_json @raw.to_json end |