Class: InfinumAzure::Users::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tasks/infinum_azure/users/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Response

Returns a new instance of Response.



8
9
10
# File 'lib/tasks/infinum_azure/users/response.rb', line 8

def initialize(raw_response)
  @raw_response = raw_response
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



6
7
8
# File 'lib/tasks/infinum_azure/users/response.rb', line 6

def raw_response
  @raw_response
end

Instance Method Details

#bodyObject



16
17
18
# File 'lib/tasks/infinum_azure/users/response.rb', line 16

def body
  @body ||= success? ? success_json : error_json
end

#success?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/tasks/infinum_azure/users/response.rb', line 12

def success?
  raw_response.is_a?(Net::HTTPSuccess)
end