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.
13751 13752 13753 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13751 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13749 13750 13751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13749 def value @value end |
Class Method Details
.ALL ⇒ Object
13771 13772 13773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13771 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
13775 13776 13777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13775 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
13756 13757 13758 13759 13760 13761 13762 13763 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13756 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
13779 13780 13781 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13779 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
13783 13784 13785 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13783 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
13787 13788 13789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13787 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
13791 13792 13793 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13791 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
13795 13796 13797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13795 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
13766 13767 13768 13769 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13766 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
13799 13800 13801 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13799 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
13803 13804 13805 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13803 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
Instance Method Details
#to_hash ⇒ Object
13815 13816 13817 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13815 def to_hash value end |