Class: Passkit::UrlGenerator

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

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initialize(pass_class, generator = nil, collection_name = nil) ⇒ UrlGenerator

Returns a new instance of UrlGenerator.

Parameters:



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

def initialize(pass_class, generator = nil, collection_name = nil)
  @url = passes_api_url(host: Passkit.configuration.web_service_host,
    payload: PayloadGenerator.encrypted(pass_class, generator, collection_name))
end

Instance Method Details

#androidString

Returns:

  • (String)

See Also:



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

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

#iosString

Returns:

  • (String)


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

def ios
  @url
end