Class: Thailand::District
- Extended by:
- SingleForwardable, Querying
- Defined in:
- lib/thailand/district.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Attributes included from Querying
Attributes inherited from Region
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}, parent = nil) ⇒ District
constructor
A new instance of District.
Methods included from Querying
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
11 12 13 |
# File 'lib/thailand/district.rb', line 11 def code @code end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/thailand/district.rb', line 18 def self.all Country.instance.subregions.map(&:subregions).flatten end |
.query_collection ⇒ Object
22 23 24 |
# File 'lib/thailand/district.rb', line 22 def self.query_collection all end |