Class: Kojn::Transactions
- Inherits:
-
Object
- Object
- Kojn::Transactions
- Defined in:
- lib/kojn/transaction.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
- #create(options = {}) ⇒ Object
- #find(id, options = {}) ⇒ Object
-
#initialize ⇒ Transactions
constructor
A new instance of Transactions.
- #update(id, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Transactions
Returns a new instance of Transactions.
18 19 20 |
# File 'lib/kojn/transaction.rb', line 18 def initialize self.access_token = Kojn.api_key end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
16 17 18 |
# File 'lib/kojn/transaction.rb', line 16 def access_token @access_token end |
Instance Method Details
#all(options = {}) ⇒ Object
22 23 24 |
# File 'lib/kojn/transaction.rb', line 22 def all( = {}) Kojn.parse_objects! Kojn::Net::get('/api/transactions').body, Kojn::Tx end |
#create(options = {}) ⇒ Object
26 27 28 |
# File 'lib/kojn/transaction.rb', line 26 def create( = {}) Kojn.parse_object! Kojn::Net::post('/api/transactions', {transaction: }).body, Kojn::Tx end |