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.
7463 7464 7465 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7463 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7461 7462 7463 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7461 def value @value end |
Class Method Details
.ALL ⇒ Object
7483 7484 7485 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7483 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
7487 7488 7489 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7487 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
7468 7469 7470 7471 7472 7473 7474 7475 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7468 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
7491 7492 7493 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7491 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
7495 7496 7497 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7495 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
7499 7500 7501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7499 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
7503 7504 7505 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7503 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
7507 7508 7509 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7507 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
7478 7479 7480 7481 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7478 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
7511 7512 7513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7511 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
7515 7516 7517 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7515 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
.mastercard ⇒ Object
7519 7520 7521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7519 def CardType.mastercard @@_mastercard ||= CardType.new('mastercard') end |
.visa ⇒ Object
7523 7524 7525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7523 def CardType.visa @@_visa ||= CardType.new('visa') end |
Instance Method Details
#to_hash ⇒ Object
7527 7528 7529 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7527 def to_hash value end |