Class: SlimpayClient::Card
- Defined in:
- lib/slimpay_client/card.rb
Overview
An abstract CardAlias to be inherited from.
Defines API CardAlias non-semantic methods.
Instance Method Summary collapse
- #get_one(id = 1) ⇒ Object
-
#initialize ⇒ Card
constructor
A new instance of Card.
Methods inherited from Base
Constructor Details
#initialize ⇒ Card
Returns a new instance of Card.
6 7 8 9 |
# File 'lib/slimpay_client/card.rb', line 6 def initialize @resource_name = self.class.to_s.demodulize.underscore.dasherize.pluralize super end |
Instance Method Details
#get_one(id = 1) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/slimpay_client/card.rb', line 11 def get_one(id = 1) url = "#{@endpoint}/cards/#{id}" response = HTTParty.get(url, headers: ) generate_api_methods(JSON.parse(response.body)) SlimpayClient.answer(response) end |