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.
13652 13653 13654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13652 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13650 13651 13652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13650 def value @value end |
Class Method Details
.ALL ⇒ Object
13672 13673 13674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13672 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
13676 13677 13678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13676 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
13657 13658 13659 13660 13661 13662 13663 13664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13657 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
13680 13681 13682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13680 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
13684 13685 13686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13684 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
13688 13689 13690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13688 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
13692 13693 13694 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13692 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
13696 13697 13698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13696 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
13667 13668 13669 13670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13667 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
13700 13701 13702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13700 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
13704 13705 13706 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13704 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
Instance Method Details
#to_hash ⇒ Object
13716 13717 13718 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13716 def to_hash value end |