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.
18475 18476 18477 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18475 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18473 18474 18475 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18473 def value @value end |
Class Method Details
.ALL ⇒ Object
18495 18496 18497 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18495 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
18480 18481 18482 18483 18484 18485 18486 18487 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18480 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.
18500 18501 18502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18500 def PaymentMethodCapability.credit @@_credit ||= PaymentMethodCapability.new('credit') end |
.debit ⇒ Object
Debit cards deduct money directly from a bank account.
18505 18506 18507 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18505 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
18490 18491 18492 18493 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18490 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
18509 18510 18511 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18509 def to_hash value end |