Class: TimeCamp::Response
- Inherits:
-
Object
- Object
- TimeCamp::Response
- Defined in:
- lib/ruby-timecamp/response.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #to_h ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/ruby-timecamp/response.rb', line 5 def initialize(response) @response = response end |
Instance Method Details
#to_h ⇒ Object
9 10 11 |
# File 'lib/ruby-timecamp/response.rb', line 9 def to_h return @response.body.present? ? JSON.parse(@response.body) : @response.body end |