Class: Machina::IdentityClient::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/machina/identity_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



7
8
9
# File 'lib/machina/identity_client.rb', line 7

def body
  @body
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



7
8
9
# File 'lib/machina/identity_client.rb', line 7

def status
  @status
end

Instance Method Details

#parsedObject



12
13
14
# File 'lib/machina/identity_client.rb', line 12

def parsed
  body.is_a?(Hash) ? body : JSON.parse(body)
end

#success?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/machina/identity_client.rb', line 8

def success?
  status.between?(200, 299)
end