Class: TwitterCldr::Shared::Territory
- Inherits:
-
Object
- Object
- TwitterCldr::Shared::Territory
- Defined in:
- lib/twitter_cldr/shared/territory.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #children ⇒ Object
- #contains?(territory_code) ⇒ Boolean
-
#initialize(territory_code) ⇒ Territory
constructor
A new instance of Territory.
- #parents ⇒ Object
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
#code ⇒ Object (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
#children ⇒ Object
24 25 26 |
# File 'lib/twitter_cldr/shared/territory.rb', line 24 def children TerritoriesContainment.children(code) end |
#contains?(territory_code) ⇒ Boolean
16 17 18 |
# File 'lib/twitter_cldr/shared/territory.rb', line 16 def contains?(territory_code) TerritoriesContainment.contains?(code, territory_code) end |
#parents ⇒ Object
20 21 22 |
# File 'lib/twitter_cldr/shared/territory.rb', line 20 def parents TerritoriesContainment.parents(code) end |