Class: Omise::OmiseObject

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/omise/object.rb

Direct Known Subclasses

Account, Balance, Card, Charge, Customer, List, Refund, Token, Transaction, Transfer

Class Attribute Summary collapse

Class Method Summary collapse

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 Attribute Details

.endpointObject

Returns the value of attribute endpoint.



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

def endpoint
  @endpoint
end

Class Method Details

.location(id = nil) ⇒ Object



12
13
14
# File 'lib/omise/object.rb', line 12

def location(id = nil)
  [endpoint, id].compact.join("/")
end

.resource(path, attributes = {}) ⇒ Object



16
17
18
19
20
# File 'lib/omise/object.rb', line 16

def resource(path, attributes = {})
  key = attributes.delete(:key) { resource_key }
  preprocess_attributes!(attributes)
  Omise.resource.new(resource_url, path, key)
end