Class: TwitterCldr::Shared::Territory

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/shared/territory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(territory_code) ⇒ Territory

Returns a new instance of Territory.



12
13
14
# File 'lib/twitter_cldr/shared/territory.rb', line 12

def initialize(territory_code)
  @code = territory_code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/twitter_cldr/shared/territory.rb', line 10

def code
  @code
end

Instance Method Details

#childrenObject



24
25
26
# File 'lib/twitter_cldr/shared/territory.rb', line 24

def children
  TerritoriesContainment.children(code)
end

#contains?(territory_code) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/twitter_cldr/shared/territory.rb', line 16

def contains?(territory_code)
  TerritoriesContainment.contains?(code, territory_code)
end

#parentsObject



20
21
22
# File 'lib/twitter_cldr/shared/territory.rb', line 20

def parents
  TerritoriesContainment.parents(code)
end