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.
8667 8668 8669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8667 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8665 8666 8667 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8665 def value @value end |
Class Method Details
.ALL ⇒ Object
8687 8688 8689 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8687 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
8691 8692 8693 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8691 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
8672 8673 8674 8675 8676 8677 8678 8679 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8672 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
8695 8696 8697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8695 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
8699 8700 8701 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8699 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
8703 8704 8705 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8703 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
8707 8708 8709 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8707 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
8711 8712 8713 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8711 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
8682 8683 8684 8685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8682 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
8715 8716 8717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8715 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
8719 8720 8721 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8719 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
Instance Method Details
#to_hash ⇒ Object
8731 8732 8733 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8731 def to_hash value end |