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.
6868 6869 6870 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6868 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6866 6867 6868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6866 def value @value end |
Class Method Details
.ALL ⇒ Object
6888 6889 6890 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6888 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
6892 6893 6894 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6892 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
6873 6874 6875 6876 6877 6878 6879 6880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6873 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
6896 6897 6898 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6896 def CardType.cartes_bancaires @@_cartes_bancaires ||= CardType.new('cartes_bancaires') end |
.china_union_pay ⇒ Object
6900 6901 6902 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6900 def CardType.china_union_pay @@_china_union_pay ||= CardType.new('china_union_pay') end |
.dankort ⇒ Object
6904 6905 6906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6904 def CardType.dankort @@_dankort ||= CardType.new('dankort') end |
.diners_club ⇒ Object
6908 6909 6910 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6908 def CardType.diners_club @@_diners_club ||= CardType.new('diners_club') end |
.discover ⇒ Object
6912 6913 6914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6912 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
6883 6884 6885 6886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6883 def CardType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardType.ALL.find { |v| v.value == value } end |
.jcb ⇒ Object
6916 6917 6918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6916 def CardType.jcb @@_jcb ||= CardType.new('jcb') end |
.maestro ⇒ Object
6920 6921 6922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6920 def CardType.maestro @@_maestro ||= CardType.new('maestro') end |
.mastercard ⇒ Object
6924 6925 6926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6924 def CardType.mastercard @@_mastercard ||= CardType.new('mastercard') end |
.visa ⇒ Object
6928 6929 6930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6928 def CardType.visa @@_visa ||= CardType.new('visa') end |
Instance Method Details
#to_hash ⇒ Object
6932 6933 6934 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6932 def to_hash value end |