Class: NPR::API::Response
- Inherits:
-
Object
- Object
- NPR::API::Response
- Includes:
- Concern::Relation
- Defined in:
- lib/npr/api/response.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
————————–.
Methods included from Concern::Relation
Constructor Details
#initialize(response) ⇒ Response
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/npr/api/response.rb', line 17 def initialize(response) create_relations(response) @_response = response @raw = response.body @version = @raw["version"] if list = @raw["list"] @list = NPR::Entity::List.new(list) end Array.wrap(@raw["message"]).each do || @messages.push NPR::API::Message.new() end end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
13 14 15 |
# File 'lib/npr/api/response.rb', line 13 def list @list end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
13 14 15 |
# File 'lib/npr/api/response.rb', line 13 def @messages end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
13 14 15 |
# File 'lib/npr/api/response.rb', line 13 def raw @raw end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
13 14 15 |
# File 'lib/npr/api/response.rb', line 13 def version @version end |