Class: GrowViral::Keystore::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Client

Returns a new instance of Client.



6
7
8
# File 'lib/keystore/client.rb', line 6

def initialize(env)
  @config = Configuration.new(env)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/keystore/client.rb', line 5

def config
  @config
end

Instance Method Details

#account_exists?(app_id, handle) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/keystore/client.rb', line 14

def (app_id, handle)
  AccountFetcher.exists?(app_id, handle, config: config)
end

#create_account(app_id, handle, uid, token, secret) ⇒ Object



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

def (app_id, handle, uid, token, secret)
  AccountCreator.create(app_id, handle, uid, token, secret, config: config)
end

#fetch_account(app_id, handle) ⇒ Object



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

def (app_id, handle)
  AccountFetcher.fetch(app_id, handle, config: config)
end

#fetch_application(provider, name) ⇒ Object



10
11
12
# File 'lib/keystore/client.rb', line 10

def fetch_application(provider, name)
  ApplicationFetcher.fetch(provider, name, config: config)
end