Class: Omise::Transfer

Inherits:
OmiseObject show all
Defined in:
lib/omise/transfer.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OmiseObject

location, resource

Methods included from Attributes

#[], #as_json, #assign_attributes, #attributes, #destroyed?, #initialize, #key?, #location, #method_missing, #respond_to?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Omise::Attributes

Class Method Details

.create(attributes = {}) ⇒ Object



14
15
16
# File 'lib/omise/transfer.rb', line 14

def self.create(attributes = {})
  new resource(location, attributes).post(attributes)
end

.list(attributes = {}) ⇒ Object



22
23
24
# File 'lib/omise/transfer.rb', line 22

def self.list(attributes = {})
  List.new resource(location, attributes).get(attributes)
end

.retrieve(id, attributes = {}) ⇒ Object



18
19
20
# File 'lib/omise/transfer.rb', line 18

def self.retrieve(id, attributes = {})
  new resource(location(id), attributes).get(attributes)
end

.searchObject



10
11
12
# File 'lib/omise/transfer.rb', line 10

def self.search
  SearchScope.new(:transfer)
end

Instance Method Details

#bank_accountObject



42
43
44
# File 'lib/omise/transfer.rb', line 42

def 
  expand_attribute BankAccount, "bank_account"
end

#destroy(attributes = {}) ⇒ Object



34
35
36
# File 'lib/omise/transfer.rb', line 34

def destroy(attributes = {})
  assign_attributes resource(attributes).delete
end

#recipient(options = {}) ⇒ Object



38
39
40
# File 'lib/omise/transfer.rb', line 38

def recipient(options = {})
  expand_attribute Recipient, "recipient", options
end

#reload(attributes = {}) ⇒ Object



26
27
28
# File 'lib/omise/transfer.rb', line 26

def reload(attributes = {})
  assign_attributes resource(attributes).get(attributes)
end

#update(attributes = {}) ⇒ Object



30
31
32
# File 'lib/omise/transfer.rb', line 30

def update(attributes = {})
  assign_attributes resource(attributes).patch(attributes)
end