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.
21424 21425 21426 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21424 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21422 21423 21424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21422 def value @value end |
Class Method Details
.ALL ⇒ Object
21444 21445 21446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21444 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
21429 21430 21431 21432 21433 21434 21435 21436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21429 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.
21449 21450 21451 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21449 def PaymentMethodCapability.credit @@_credit ||= PaymentMethodCapability.new('credit') end |
.debit ⇒ Object
Debit cards deduct money directly from a bank account.
21454 21455 21456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21454 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
21439 21440 21441 21442 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21439 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
21458 21459 21460 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21458 def to_hash value end |