Class: Workarea::Emarsys::Response

Inherits:
Object
  • Object
show all
Defined in:
app/lib/workarea/emarsys/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



4
5
6
# File 'app/lib/workarea/emarsys/response.rb', line 4

def initialize(response)
  @response = response
end

Instance Method Details

#bodyObject



12
13
14
15
# File 'app/lib/workarea/emarsys/response.rb', line 12

def body
  return unless @response.body
  @body ||= JSON.parse(@response.body)
end

#success?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/lib/workarea/emarsys/response.rb', line 8

def success?
  @response.success?
end