Class: VeezoLocationApi::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/veezo_location_api/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(success:, status_code:, data: nil) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
# File 'lib/veezo_location_api/response.rb', line 7

def initialize(success:, status_code:, data: nil)
  @success = success
  @status_code =  status_code
  @data = data if success?
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/veezo_location_api/response.rb', line 5

def data
  @data
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



5
6
7
# File 'lib/veezo_location_api/response.rb', line 5

def status_code
  @status_code
end

#successObject (readonly)

Returns the value of attribute success.



5
6
7
# File 'lib/veezo_location_api/response.rb', line 5

def success
  @success
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/veezo_location_api/response.rb', line 13

def success?
  @success || false
end