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.
8972 8973 8974 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8972 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8970 8971 8972 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8970 def value @value end |
Class Method Details
.ALL ⇒ Object
8992 8993 8994 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8992 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
8996 8997 8998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8996 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
8977 8978 8979 8980 8981 8982 8983 8984 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8977 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
9000 9001 9002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9000 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
9004 9005 9006 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9004 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
9008 9009 9010 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9008 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
9012 9013 9014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9012 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
9016 9017 9018 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9016 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
8987 8988 8989 8990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8987 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
9020 9021 9022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9020 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
9024 9025 9026 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9024 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
Instance Method Details
#to_hash ⇒ Object
9036 9037 9038 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9036 def to_hash value end |