Class: Cccode::Codes
- Inherits:
-
Object
- Object
- Cccode::Codes
- Defined in:
- lib/cccode.rb
Overview
database data
Instance Attribute Summary collapse
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
Instance Method Summary collapse
-
#initialize(country) ⇒ Codes
constructor
Cccode::Codes.new(‘Germany’).
Constructor Details
#initialize(country) ⇒ Codes
Cccode::Codes.new(‘Germany’)
14 15 16 17 18 19 20 21 22 |
# File 'lib/cccode.rb', line 14 def initialize(country) record = Cccode::CountryCode.where(country: country).first if record @country = record.country @country_code = record.country_code @currency = record.currency @currency_code = record.currency_code end end |
Instance Attribute Details
#country ⇒ Object
Returns the value of attribute country.
11 12 13 |
# File 'lib/cccode.rb', line 11 def country @country end |
#country_code ⇒ Object
Returns the value of attribute country_code.
11 12 13 |
# File 'lib/cccode.rb', line 11 def country_code @country_code end |
#currency ⇒ Object
Returns the value of attribute currency.
11 12 13 |
# File 'lib/cccode.rb', line 11 def currency @currency end |
#currency_code ⇒ Object
Returns the value of attribute currency_code.
11 12 13 |
# File 'lib/cccode.rb', line 11 def currency_code @currency_code end |