Class: TransparentData::Response::Struct

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/transparent_data/response/struct.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Struct

Returns a new instance of Struct.



8
9
10
# File 'lib/transparent_data/response/struct.rb', line 8

def initialize(response)
  @response = response
end

Instance Method Details

#bodyObject



12
13
14
15
16
# File 'lib/transparent_data/response/struct.rb', line 12

def body
  JSON.parse(@response.body)
rescue JSON::ParserError
  @response.body
end