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.
8004 8005 8006 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8004 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8002 8003 8004 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8002 def value @value end |
Class Method Details
.ALL ⇒ Object
8024 8025 8026 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8024 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
8028 8029 8030 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8028 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
8009 8010 8011 8012 8013 8014 8015 8016 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8009 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
8032 8033 8034 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8032 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
8036 8037 8038 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8036 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
8040 8041 8042 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8040 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
8044 8045 8046 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8044 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
8048 8049 8050 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8048 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
8019 8020 8021 8022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8019 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
8052 8053 8054 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8052 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
8056 8057 8058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8056 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
.mastercard ⇒ Object
8060 8061 8062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8060 def CardType.mastercard @@_mastercard ||= CardType.new('mastercard') end |
.visa ⇒ Object
8064 8065 8066 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8064 def CardType.visa @@_visa ||= CardType.new('visa') end |
Instance Method Details
#to_hash ⇒ Object
8068 8069 8070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8068 def to_hash value end |