Class: Io::Flow::V0::Models::PaymentType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentType
- 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
- .afterpay ⇒ Object
- .ALL ⇒ Object
- .applepay ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of PaymentType for this value, creating a new instance for an unknown value.
- .card ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of PaymentType for this value, or nil if not found.
- .googlepay ⇒ Object
- .ideal ⇒ Object
- .klarna ⇒ Object
- .paypal ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ PaymentType
constructor
A new instance of PaymentType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PaymentType
Returns a new instance of PaymentType.
21720 21721 21722 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21720 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21718 21719 21720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21718 def value @value end |
Class Method Details
.afterpay ⇒ Object
21768 21769 21770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21768 def PaymentType.afterpay @@_afterpay ||= PaymentType.new('afterpay') end |
.ALL ⇒ Object
21740 21741 21742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21740 def PaymentType.ALL @@all ||= [PaymentType.card, PaymentType.klarna, PaymentType.googlepay, PaymentType.paypal, PaymentType.applepay, PaymentType.ideal, PaymentType.afterpay] end |
.applepay ⇒ Object
21760 21761 21762 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21760 def PaymentType.applepay @@_applepay ||= PaymentType.new('applepay') end |
.apply(value) ⇒ Object
Returns the instance of PaymentType for this value, creating a new instance for an unknown value
21725 21726 21727 21728 21729 21730 21731 21732 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21725 def PaymentType.apply(value) if value.instance_of?(PaymentType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || PaymentType.new(value)) end end |
.card ⇒ Object
21744 21745 21746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21744 def PaymentType.card @@_card ||= PaymentType.new('card') end |
.from_string(value) ⇒ Object
Returns the instance of PaymentType for this value, or nil if not found
21735 21736 21737 21738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21735 def PaymentType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PaymentType.ALL.find { |v| v.value == value } end |
.googlepay ⇒ Object
21752 21753 21754 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21752 def PaymentType.googlepay @@_googlepay ||= PaymentType.new('googlepay') end |
.ideal ⇒ Object
21764 21765 21766 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21764 def PaymentType.ideal @@_ideal ||= PaymentType.new('ideal') end |
.klarna ⇒ Object
21748 21749 21750 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21748 def PaymentType.klarna @@_klarna ||= PaymentType.new('klarna') end |
.paypal ⇒ Object
21756 21757 21758 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21756 def PaymentType.paypal @@_paypal ||= PaymentType.new('paypal') end |
Instance Method Details
#to_hash ⇒ Object
21772 21773 21774 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21772 def to_hash value end |