Class: Io::Flow::V0::Models::CardType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CardType
- 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
- .american_express ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of CardType for this value, creating a new instance for an unknown value.
- .cartes_bancaires ⇒ Object
- .china_union_pay ⇒ Object
- .dankort ⇒ Object
- .diners_club ⇒ Object
- .discover ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of CardType for this value, or nil if not found.
- .jcb ⇒ Object
- .maestro ⇒ Object
- .mastercard ⇒ Object
- .visa ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ CardType
constructor
A new instance of CardType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CardType
Returns a new instance of CardType.
17721 17722 17723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17721 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17719 17720 17721 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17719 def value @value end |
Class Method Details
.ALL ⇒ Object
17741 17742 17743 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17741 def CardType.ALL @@all ||= [CardType.american_express, CardType.cartes_bancaires, CardType.china_union_pay, CardType.dankort, CardType.diners_club, CardType.discover, CardType.jcb, CardType.maestro, CardType.mastercard, CardType.visa] end |
.american_express ⇒ Object
17745 17746 17747 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17745 def CardType.american_express @@_american_express ||= CardType.new('american_express') end |
.apply(value) ⇒ Object
Returns the instance of CardType for this value, creating a new instance for an unknown value
17726 17727 17728 17729 17730 17731 17732 17733 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17726 def CardType.apply(value) if value.instance_of?(CardType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CardType.new(value)) end end |
.cartes_bancaires ⇒ Object
17749 17750 17751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17749 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
17753 17754 17755 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17753 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
17757 17758 17759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17757 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
17761 17762 17763 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17761 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
17765 17766 17767 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17765 def CardType.discover @@_discover ||= CardType.new('discover') end |
.from_string(value) ⇒ Object
Returns the instance of CardType for this value, or nil if not found
17736 17737 17738 17739 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17736 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
17769 17770 17771 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17769 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
17773 17774 17775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17773 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
Instance Method Details
#to_hash ⇒ Object
17785 17786 17787 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17785 def to_hash value end |