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.
22460 22461 22462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22460 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
22458 22459 22460 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22458 def value @value end |
Class Method Details
.ALL ⇒ Object
22480 22481 22482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22480 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
22465 22466 22467 22468 22469 22470 22471 22472 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22465 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.
22485 22486 22487 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22485 def PaymentMethodCapability.credit @@_credit ||= PaymentMethodCapability.new('credit') end |
.debit ⇒ Object
Debit cards deduct money directly from a bank account.
22490 22491 22492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22490 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
22475 22476 22477 22478 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22475 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
22494 22495 22496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22494 def to_hash value end |