Class: Gaigo::Countries::Country

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(en, code, native) ⇒ Country

Returns a new instance of Country.



9
10
11
12
13
14
# File 'lib/gaigo/countries.rb', line 9

def initialize(en, code, native)
  @en = en
  @code = code
  @native = native
  freeze
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/gaigo/countries.rb', line 8

def code
  @code
end

#enObject (readonly)

Returns the value of attribute en.



8
9
10
# File 'lib/gaigo/countries.rb', line 8

def en
  @en
end

#nativeObject (readonly)

Returns the value of attribute native.



8
9
10
# File 'lib/gaigo/countries.rb', line 8

def native
  @native
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/gaigo/countries.rb', line 15

def to_s
  "#{en} (#{native})"
end