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.
10669 10670 10671 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10669 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10667 10668 10669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10667 def value @value end |
Class Method Details
.ALL ⇒ Object
10689 10690 10691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10689 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
10693 10694 10695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10693 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
10674 10675 10676 10677 10678 10679 10680 10681 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10674 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
10697 10698 10699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10697 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
10701 10702 10703 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10701 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
10705 10706 10707 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10705 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
10709 10710 10711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10709 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
10713 10714 10715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10713 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
10684 10685 10686 10687 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10684 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
10717 10718 10719 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10717 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
10721 10722 10723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10721 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
.mastercard ⇒ Object
10725 10726 10727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10725 def CardType.mastercard @@_mastercard ||= CardType.new('mastercard') end |
.visa ⇒ Object
10729 10730 10731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10729 def CardType.visa @@_visa ||= CardType.new('visa') end |
Instance Method Details
#to_hash ⇒ Object
10733 10734 10735 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10733 def to_hash value end |