Class: CandyCheck::AppStore::VerificationFailure

Inherits:
Object
  • Object
show all
Defined in:
lib/candy_check/app_store/verification_failure.rb

Overview

Represents a failing call against the verification server

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ VerificationFailure

Initializes a new instance which bases on a JSON result from Apple servers

Parameters:

  • code (Integer)
  • message (String)


15
16
17
18
# File 'lib/candy_check/app_store/verification_failure.rb', line 15

def initialize(code, message)
  @code = code
  @message = message
end

Instance Attribute Details

#codeInteger (readonly)

Returns the code of the failure.

Returns:

  • (Integer)

    the code of the failure



6
7
8
# File 'lib/candy_check/app_store/verification_failure.rb', line 6

def code
  @code
end

#messageString (readonly)

Returns the message of the failure.

Returns:

  • (String)

    the message of the failure



9
10
11
# File 'lib/candy_check/app_store/verification_failure.rb', line 9

def message
  @message
end

Class Method Details

.fetch(code) ⇒ VerificationFailure

Gets a known failure or build an unknown failure without description

Parameters:

  • code (Integer)

Returns:



25
26
27
28
29
# File 'lib/candy_check/app_store/verification_failure.rb', line 25

def fetch(code)
  known.fetch(code) do
    fallback(code)
  end
end