Class: Thailand::Province

Inherits:
Region
  • Object
show all
Extended by:
SingleForwardable, Querying
Defined in:
lib/thailand/province.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_data_path, #subregions, #subregions?, #to_s

Constructor Details

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

Returns a new instance of Province.



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

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#regionObject (readonly)

Returns the value of attribute region.



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

def region
  @region
end

Class Method Details

.allObject



27
28
29
# File 'lib/thailand/province.rb', line 27

def self.all
  Country.instance.subregions
end

.query_collectionObject



31
32
33
# File 'lib/thailand/province.rb', line 31

def self.query_collection
  all
end

Instance Method Details

#subregion_classObject



23
24
25
# File 'lib/thailand/province.rb', line 23

def subregion_class
  District
end