Class: VSafe::CardType
- Inherits:
-
Object
- Object
- VSafe::CardType
- Defined in:
- lib/vsafe/card_type.rb
Constant Summary collapse
- AMERICAN_EXPRESS =
3
- VISA =
4
- MASTERCARD =
5
- DISCOVER =
6
- DINERS_CLUB =
7
- OPTIMA =
10
- HUMANIZED_NAMES =
{ AMERICAN_EXPRESS => "American Express".freeze, VISA => "Visa".freeze, MASTERCARD => "MasterCard".freeze, DISCOVER => "Discover".freeze, DINERS_CLUB => "Diners Club".freeze, OPTIMA => "Optima".freeze }
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(code) ⇒ CardType
constructor
A new instance of CardType.
Constructor Details
#initialize(code) ⇒ CardType
Returns a new instance of CardType.
21 22 23 |
# File 'lib/vsafe/card_type.rb', line 21 def initialize(code) @code = code.to_i end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
19 20 21 |
# File 'lib/vsafe/card_type.rb', line 19 def code @code end |
Instance Method Details
#description ⇒ Object
25 26 27 |
# File 'lib/vsafe/card_type.rb', line 25 def description HUMANIZED_NAMES[code] end |