Class: Increase::Resources::Cards
- Inherits:
-
Object
- Object
- Increase::Resources::Cards
- Defined in:
- lib/increase/resources/cards.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Increase::Models::Card
Create a Card.
-
#details(card_id, opts = {}) ⇒ Increase::Models::CardDetails
Retrieve sensitive details for a Card.
-
#initialize(client:) ⇒ Cards
constructor
A new instance of Cards.
-
#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::Card>
List Cards.
-
#retrieve(card_id, opts = {}) ⇒ Increase::Models::Card
Retrieve a Card.
-
#update(card_id, params = {}, opts = {}) ⇒ Increase::Models::Card
Update a Card.
Constructor Details
#initialize(client:) ⇒ Cards
Returns a new instance of Cards.
6 7 8 |
# File 'lib/increase/resources/cards.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Increase::Models::Card
Create a Card
27 28 29 30 31 32 33 34 |
# File 'lib/increase/resources/cards.rb', line 27 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/cards" req[:body] = params req[:model] = Increase::Models::Card @client.request(req, opts) end |
#details(card_id, opts = {}) ⇒ Increase::Models::CardDetails
Retrieve sensitive details for a Card
108 109 110 111 112 113 114 |
# File 'lib/increase/resources/cards.rb', line 108 def details(card_id, opts = {}) req = {} req[:method] = :get req[:path] = "/cards/#{card_id}/details" req[:model] = Increase::Models::CardDetails @client.request(req, opts) end |
#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::Card>
List Cards
92 93 94 95 96 97 98 99 100 |
# File 'lib/increase/resources/cards.rb', line 92 def list(params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/cards" req[:query] = params req[:page] = Increase::Page req[:model] = Increase::Models::Card @client.request(req, opts) end |
#retrieve(card_id, opts = {}) ⇒ Increase::Models::Card
Retrieve a Card
42 43 44 45 46 47 48 |
# File 'lib/increase/resources/cards.rb', line 42 def retrieve(card_id, opts = {}) req = {} req[:method] = :get req[:path] = "/cards/#{card_id}" req[:model] = Increase::Models::Card @client.request(req, opts) end |
#update(card_id, params = {}, opts = {}) ⇒ Increase::Models::Card
Update a Card
67 68 69 70 71 72 73 74 |
# File 'lib/increase/resources/cards.rb', line 67 def update(card_id, params = {}, opts = {}) req = {} req[:method] = :patch req[:path] = "/cards/#{card_id}" req[:body] = params req[:model] = Increase::Models::Card @client.request(req, opts) end |