Class: Widgeo::Territory

Inherits:
Object
  • Object
show all
Extended by:
Collection
Includes:
Model
Defined in:
lib/widgeo/territory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Collection

all, dataset, dataset_file, filter_by, find_by, matches?

Methods included from Model

#initialize

Instance Attribute Details

#alpha_2Object (readonly)

Returns the value of attribute alpha_2.



8
9
10
# File 'lib/widgeo/territory.rb', line 8

def alpha_2
  @alpha_2
end

#continent_alpha_2Object (readonly)

Returns the value of attribute continent_alpha_2.



8
9
10
# File 'lib/widgeo/territory.rb', line 8

def continent_alpha_2
  @continent_alpha_2
end

#long_nameObject (readonly)

Returns the value of attribute long_name.



8
9
10
# File 'lib/widgeo/territory.rb', line 8

def long_name
  @long_name
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/widgeo/territory.rb', line 8

def name
  @name
end

Instance Method Details

#continentObject

Load an instance of the continent



13
14
15
16
17
# File 'lib/widgeo/territory.rb', line 13

def continent

  Continent.find_by :alpha_2, continent_alpha_2

end