Class: Kiik::Wallet::Creditcard
- Inherits:
-
Object
- Object
- Kiik::Wallet::Creditcard
- Defined in:
- lib/kiik/wallet/creditcard.rb
Instance Method Summary collapse
- #create(token, options = {}, &block) ⇒ Object
- #detail(token, id, &block) ⇒ Object
- #get(token, id, &block) ⇒ Object
-
#initialize(client) ⇒ Creditcard
constructor
A new instance of Creditcard.
- #list(token, &block) ⇒ Object
Constructor Details
#initialize(client) ⇒ Creditcard
Returns a new instance of Creditcard.
5 6 7 8 |
# File 'lib/kiik/wallet/creditcard.rb', line 5 def initialize(client) @client = client @base_uri = '/cards' end |
Instance Method Details
#create(token, options = {}, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kiik/wallet/creditcard.rb', line 10 def create(token,={},&block) params = { :card => { :name => [:name], :number => [:number], :expiration_month => [:expiration_month], :expiration_year => [:expiration_year] } } request(token,:post,@base_uri,params,&block) end |
#detail(token, id, &block) ⇒ Object
31 32 33 |
# File 'lib/kiik/wallet/creditcard.rb', line 31 def detail(token,id,&block) request(token,:get,"#{@base_uri}/#{id}/details",{},&block) end |
#get(token, id, &block) ⇒ Object
27 28 29 |
# File 'lib/kiik/wallet/creditcard.rb', line 27 def get(token,id,&block) request(token,:get,"#{@base_uri}/#{id}",{},&block) end |
#list(token, &block) ⇒ Object
23 24 25 |
# File 'lib/kiik/wallet/creditcard.rb', line 23 def list(token,&block) request(token,:get,@base_uri,{},&block) end |