Class: NPR::API::Message
- Inherits:
-
Object
- Object
- NPR::API::Message
- Includes:
- Concern::ShallowAttributes
- Defined in:
- lib/npr/api/message.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#level ⇒ Object
Returns the value of attribute level.
Instance Method Summary collapse
-
#error? ⇒ Boolean
——————.
-
#initialize(json) ⇒ Message
constructor
——————.
-
#warning? ⇒ Boolean
——————.
Methods included from Concern::ShallowAttributes
Constructor Details
#initialize(json) ⇒ Message
17 18 19 20 21 22 23 |
# File 'lib/npr/api/message.rb', line 17 def initialize(json) @_json = json @id = @_json["id"] @level = @_json["level"] extract_shallow_attributes(@_json) end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/npr/api/message.rb', line 12 def id @id end |
#level ⇒ Object
Returns the value of attribute level.
12 13 14 |
# File 'lib/npr/api/message.rb', line 12 def level @level end |
Instance Method Details
#error? ⇒ Boolean
27 28 29 |
# File 'lib/npr/api/message.rb', line 27 def error? self.level == "error" end |
#warning? ⇒ Boolean
33 34 35 |
# File 'lib/npr/api/message.rb', line 33 def warning? self.level == "warning" end |