Class: TimeCamp::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-timecamp/response.rb

Instance Method Summary collapse

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_hObject



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