Class: Io::Flow::V0::Models::PaymentMethodCapability
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentMethodCapability
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of PaymentMethodCapability for this value, creating a new instance for an unknown value.
-
.credit ⇒ Object
Credit cards provide access to a line of debt issued by a bank.
-
.debit ⇒ Object
Debit cards deduct money directly from a bank account.
-
.from_string(value) ⇒ Object
Returns the instance of PaymentMethodCapability for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ PaymentMethodCapability
constructor
A new instance of PaymentMethodCapability.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PaymentMethodCapability
Returns a new instance of PaymentMethodCapability.
18524 18525 18526 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18524 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18522 18523 18524 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18522 def value @value end |
Class Method Details
.ALL ⇒ Object
18544 18545 18546 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18544 def PaymentMethodCapability.ALL @@all ||= [PaymentMethodCapability.credit, PaymentMethodCapability.debit] end |
.apply(value) ⇒ Object
Returns the instance of PaymentMethodCapability for this value, creating a new instance for an unknown value
18529 18530 18531 18532 18533 18534 18535 18536 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18529 def PaymentMethodCapability.apply(value) if value.instance_of?(PaymentMethodCapability) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || PaymentMethodCapability.new(value)) end end |
.credit ⇒ Object
Credit cards provide access to a line of debt issued by a bank.
18549 18550 18551 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18549 def PaymentMethodCapability.credit @@_credit ||= PaymentMethodCapability.new('credit') end |
.debit ⇒ Object
Debit cards deduct money directly from a bank account.
18554 18555 18556 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18554 def PaymentMethodCapability.debit @@_debit ||= PaymentMethodCapability.new('debit') end |
.from_string(value) ⇒ Object
Returns the instance of PaymentMethodCapability for this value, or nil if not found
18539 18540 18541 18542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18539 def PaymentMethodCapability.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PaymentMethodCapability.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
18558 18559 18560 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18558 def to_hash value end |