Class: Kiik::Wallet

Inherits:
Object
  • Object
show all
Defined in:
lib/kiik/wallet.rb,
lib/kiik/wallet/user.rb,
lib/kiik/wallet/client.rb,
lib/kiik/wallet/creditcard.rb,
lib/kiik/wallet/transaction.rb

Defined Under Namespace

Classes: Client, Creditcard, Transaction, User

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, options = {}) ⇒ Wallet

Returns a new instance of Wallet.



7
8
9
10
11
12
13
14
15
# File 'lib/kiik/wallet.rb', line 7

def initialize(token,options={})
  @site = 'https://wallet.kiik.com.br'
  @version = 'v1'
  @token = token
  @ca_file = options.delete(:ca_file) || default_ca_file
  @logger = options.delete(:logger) || Kiik::Logger
  @options = options
  return true
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/kiik/wallet.rb', line 5

def logger
  @logger
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/kiik/wallet.rb', line 5

def options
  @options
end

#siteObject (readonly)

Returns the value of attribute site.



4
5
6
# File 'lib/kiik/wallet.rb', line 4

def site
  @site
end

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'lib/kiik/wallet.rb', line 4

def token
  @token
end

#versionObject (readonly)

Returns the value of attribute version.



4
5
6
# File 'lib/kiik/wallet.rb', line 4

def version
  @version
end

Instance Method Details

#apiObject



21
22
23
# File 'lib/kiik/wallet.rb', line 21

def api
  @api ||= Kiik::Wallet::Client.new(self,options)
end

#clientObject



17
18
19
# File 'lib/kiik/wallet.rb', line 17

def client
  @client ||= Kiik::Client.new(token,:site => { :url => site },:ssl => client_ssl_options)
end