Class: Thailand::District

Inherits:
Region
  • Object
show all
Extended by:
SingleForwardable, Querying
Defined in:
lib/thailand/district.rb

Instance Attribute Summary collapse

Attributes included from Querying

#case_fold

Attributes inherited from Region

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Querying

coded, named

Methods inherited from Region

#<=>, #inspect, #name, #path, #reset!, #subregion_class, #subregion_data_path, #subregions, #subregions?, #to_s

Constructor Details

#initialize(data = {}, parent = nil) ⇒ District

Returns a new instance of District.



13
14
15
16
# File 'lib/thailand/district.rb', line 13

def initialize(data = {}, parent = nil)
  @code = data['code']
  super
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



11
12
13
# File 'lib/thailand/district.rb', line 11

def code
  @code
end

Class Method Details

.allObject



18
19
20
# File 'lib/thailand/district.rb', line 18

def self.all
  Country.instance.subregions.map(&:subregions).flatten
end

.query_collectionObject



22
23
24
# File 'lib/thailand/district.rb', line 22

def self.query_collection
  all
end