Class: BerlinBuehnen::Response
- Inherits:
-
Object
- Object
- BerlinBuehnen::Response
- Defined in:
- lib/berlin_buehnen/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#json_response ⇒ Object
readonly
Returns the value of attribute json_response.
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(json_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(json_response) ⇒ Response
Returns a new instance of Response.
11 12 13 |
# File 'lib/berlin_buehnen/response.rb', line 11 def initialize(json_response) @json_response = json_response end |
Instance Attribute Details
#json_response ⇒ Object (readonly)
Returns the value of attribute json_response.
3 4 5 |
# File 'lib/berlin_buehnen/response.rb', line 3 def json_response @json_response end |
Class Method Details
.create(response) ⇒ Object
5 6 7 8 9 |
# File 'lib/berlin_buehnen/response.rb', line 5 def self.create(response) json_response = JSON.parse(response.body) json_response.has_key?("meta") ? ListResponse.new(json_response) : new(json_response) end |
Instance Method Details
#data ⇒ Object
15 16 17 |
# File 'lib/berlin_buehnen/response.rb', line 15 def data @data ||= @json_response end |