Class: Omise::Capability

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

Defined Under Namespace

Classes: PaymentMethod

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, #predicate?, #respond_to_missing?

Dynamic Method Handling

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

Class Method Details

.resource_keyObject



16
17
18
# File 'lib/omise/capability.rb', line 16

def self.resource_key
  Omise.public_api_key
end

Instance Method Details

#payment_methodsObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/omise/capability.rb', line 20

def payment_methods
  self["payment_methods"].map do |payment_method|
    PaymentMethod.new(
      payment_method["object"],
      payment_method["name"],
      payment_method["currencies"],
      payment_method["card_brands"],
      payment_method["installment_terms"]
    )
  end
end