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.
8631 8632 8633 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8631 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8629 8630 8631 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8629 def value @value end |
Class Method Details
.ALL ⇒ Object
8651 8652 8653 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8651 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
8655 8656 8657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8655 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
8636 8637 8638 8639 8640 8641 8642 8643 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8636 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
8659 8660 8661 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8659 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
8663 8664 8665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8663 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
8667 8668 8669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8667 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
8671 8672 8673 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8671 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
8675 8676 8677 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8675 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
8646 8647 8648 8649 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8646 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
8679 8680 8681 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8679 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
8683 8684 8685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8683 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
Instance Method Details
#to_hash ⇒ Object
8695 8696 8697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8695 def to_hash value end |