Class: CandyCheck::PlayStore::VerificationFailure

Inherits:
Object
  • Object
show all
Includes:
Utils::AttributeReader
Defined in:
lib/candy_check/play_store/verification_failure.rb

Overview

Represents a failing call against the Google API server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ VerificationFailure

Initializes a new instance which bases on a JSON result from Google API servers

Parameters:

  • error (Hash)


13
14
15
# File 'lib/candy_check/play_store/verification_failure.rb', line 13

def initialize(error)
  @error = error
end

Instance Attribute Details

#errorHash (readonly)

Returns the raw attributes returned from the server.

Returns:

  • (Hash)

    the raw attributes returned from the server



8
9
10
# File 'lib/candy_check/play_store/verification_failure.rb', line 8

def error
  @error
end

Instance Method Details

#codeInteger

The code of the failure

Returns:

  • (Integer)


19
20
21
22
23
# File 'lib/candy_check/play_store/verification_failure.rb', line 19

def code
  Integer(error.status_code)
rescue StandardError
  -1
end

#messageString

The message of the failure

Returns:

  • (String)


27
28
29
# File 'lib/candy_check/play_store/verification_failure.rb', line 27

def message
  error.message || "Unknown error"
end