Class: Passkit::UrlGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/passkit/url_generator.rb

Constant Summary collapse

WALLET_PASS_PREFIX =
"https://walletpass.io?u=".freeze

Instance Method Summary collapse

Constructor Details

#initialize(pass_class, generator = nil) ⇒ UrlGenerator

Returns a new instance of UrlGenerator.



5
6
7
8
# File 'lib/passkit/url_generator.rb', line 5

def initialize(pass_class, generator = nil)
  @url = passes_api_url(host: ENV["PASSKIT_WEB_SERVICE_HOST"],
    payload: PayloadGenerator.encrypted(pass_class, generator))
end

Instance Method Details

#androidObject



16
17
18
# File 'lib/passkit/url_generator.rb', line 16

def android
  "#{WALLET_PASS_PREFIX}#{@url}"
end

#iosObject



10
11
12
# File 'lib/passkit/url_generator.rb', line 10

def ios
  @url
end