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.
17920 17921 17922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17920 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17918 17919 17920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17918 def value @value end |
Class Method Details
.ALL ⇒ Object
17940 17941 17942 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17940 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
17925 17926 17927 17928 17929 17930 17931 17932 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17925 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.
17945 17946 17947 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17945 def PaymentMethodCapability.credit @@_credit ||= PaymentMethodCapability.new('credit') end |
.debit ⇒ Object
Debit cards deduct money directly from a bank account.
17950 17951 17952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17950 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
17935 17936 17937 17938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17935 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
17954 17955 17956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17954 def to_hash value end |