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.
14082 14083 14084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14082 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14080 14081 14082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14080 def value @value end |
Class Method Details
.ALL ⇒ Object
14102 14103 14104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14102 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
14106 14107 14108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14106 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
14087 14088 14089 14090 14091 14092 14093 14094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14087 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
14110 14111 14112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14110 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
14114 14115 14116 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14114 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
14118 14119 14120 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14118 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
14122 14123 14124 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14122 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
14126 14127 14128 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14126 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
14097 14098 14099 14100 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14097 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
14130 14131 14132 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14130 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
14134 14135 14136 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14134 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
.mastercard ⇒ Object
14138 14139 14140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14138 def CardType.mastercard @@_mastercard ||= CardType.new('mastercard') end |
.visa ⇒ Object
14142 14143 14144 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14142 def CardType.visa @@_visa ||= CardType.new('visa') end |
Instance Method Details
#to_hash ⇒ Object
14146 14147 14148 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14146 def to_hash value end |