Class: PassNinja::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(account_id, api_key, host = 'https://api.passninja.com') ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/passninja.rb', line 6

def initialize(, api_key, host = 'https://api.passninja.com')
  @account_id = 
  @api_key = api_key
  @host = host
  url = URI.parse(host)
  if url.instance_of? URI::HTTPS
    @use_ssl = true
  else
    @use_ssl = false 
  end
end

Instance Method Details

#pass_templatesObject



18
19
20
# File 'lib/passninja.rb', line 18

def pass_templates
  PassTemplates.new(@account_id, @api_key, @host, @use_ssl)
end

#passesObject



22
23
24
# File 'lib/passninja.rb', line 22

def passes
  Passes.new(@account_id, @api_key, @host, @use_ssl)
end