Class: Cccode::Codes

Inherits:
Object
  • Object
show all
Defined in:
lib/cccode.rb

Overview

database data

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#countryObject

Returns the value of attribute country.



11
12
13
# File 'lib/cccode.rb', line 11

def country
  @country
end

#country_codeObject

Returns the value of attribute country_code.



11
12
13
# File 'lib/cccode.rb', line 11

def country_code
  @country_code
end

#currencyObject

Returns the value of attribute currency.



11
12
13
# File 'lib/cccode.rb', line 11

def currency
  @currency
end

#currency_codeObject

Returns the value of attribute currency_code.



11
12
13
# File 'lib/cccode.rb', line 11

def currency_code
  @currency_code
end