Class: CandyCheck::CLI::Commands::AppStore

Inherits:
Base
  • Object
show all
Defined in:
lib/candy_check/cli/commands/app_store.rb

Overview

Command to verify an AppStore receipt token

Instance Method Summary collapse

Methods inherited from Base

run

Constructor Details

#initialize(receipt, options) ⇒ AppStore

Prepare a verification run from the terminal

Parameters:

  • receipt (String)
  • options (Hash)

Options Hash (options):

  • :secret (String)

    A shared secret to use

  • :environment (String)

    The environment to use



11
12
13
14
# File 'lib/candy_check/cli/commands/app_store.rb', line 11

def initialize(receipt, options)
  @receipt = receipt
  super(options)
end

Instance Method Details

#runObject

Print the result of the verification to the terminal



17
18
19
20
21
22
# File 'lib/candy_check/cli/commands/app_store.rb', line 17

def run
  verifier = CandyCheck::AppStore::Verifier.new(config)
  result = verifier.verify(@receipt, options[:secret])
  out.print "#{result.class}:"
  out.pretty result
end