Class: Gyftwrapper::API
- Inherits:
-
Object
- Object
- Gyftwrapper::API
- Includes:
- Resultable
- Defined in:
- lib/gyftwrapper/api.rb
Constant Summary collapse
- CALLS =
{ purchase_card: '/reseller/purchase/card' }
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize ⇒ API
constructor
A new instance of API.
- #purchase_card(params) ⇒ Object
Constructor Details
#initialize ⇒ API
Returns a new instance of API.
19 20 21 22 |
# File 'lib/gyftwrapper/api.rb', line 19 def initialize self.result = Result.new self.config = parse_config_file end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
17 18 19 |
# File 'lib/gyftwrapper/api.rb', line 17 def config @config end |
#result ⇒ Object
Returns the value of attribute result.
17 18 19 |
# File 'lib/gyftwrapper/api.rb', line 17 def result @result end |
Instance Method Details
#purchase_card(params) ⇒ Object
24 25 26 27 28 |
# File 'lib/gyftwrapper/api.rb', line 24 def purchase_card(params) send_request do RestClient.post(url_for(:purchase_card), params.merge(default_params), 'x-sig-timestamp' => ) end end |