Class: CandyCheck::PlayStore::ProductAcknowledgements::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/candy_check/play_store/product_acknowledgements/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result:, error_data:) ⇒ Response

Returns a new instance of Response.



5
6
7
8
# File 'lib/candy_check/play_store/product_acknowledgements/response.rb', line 5

def initialize(result:, error_data:)
  @result = result
  @error_data = error_data
end

Instance Attribute Details

#error_dataObject (readonly)

Returns the value of attribute error_data.



20
21
22
# File 'lib/candy_check/play_store/product_acknowledgements/response.rb', line 20

def error_data
  @error_data
end

#resultObject (readonly)

Returns the value of attribute result.



20
21
22
# File 'lib/candy_check/play_store/product_acknowledgements/response.rb', line 20

def result
  @result
end

Instance Method Details

#acknowledged?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/candy_check/play_store/product_acknowledgements/response.rb', line 10

def acknowledged?
  !!result
end

#errorObject



14
15
16
17
18
# File 'lib/candy_check/play_store/product_acknowledgements/response.rb', line 14

def error
  return unless error_data

  { status_code: error_data.status_code, body: error_data.body }
end