Class: Widgeo::Territory

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

Overview

Working with territories

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.



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

def alpha_2
  @alpha_2
end

#continent_alpha_2Object (readonly)

Returns the value of attribute continent_alpha_2.



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

def continent_alpha_2
  @continent_alpha_2
end

#long_nameObject (readonly)

Returns the value of attribute long_name.



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

def long_name
  @long_name
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#continentObject

Load an instance of the continent



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

def continent
  Continent.find_by :alpha_2, continent_alpha_2
end