Class: Thailand::Province
- Extended by:
- SingleForwardable, Querying
- Defined in:
- lib/thailand/province.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Attributes included from Querying
Attributes inherited from Region
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}, parent = nil) ⇒ Province
constructor
A new instance of Province.
- #subregion_class ⇒ Object
Methods included from Querying
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
11 12 13 |
# File 'lib/thailand/province.rb', line 11 def code @code end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
11 12 13 |
# File 'lib/thailand/province.rb', line 11 def region @region end |
Class Method Details
.all ⇒ Object
27 28 29 |
# File 'lib/thailand/province.rb', line 27 def self.all Country.instance.subregions end |
.query_collection ⇒ Object
31 32 33 |
# File 'lib/thailand/province.rb', line 31 def self.query_collection all end |
Instance Method Details
#subregion_class ⇒ Object
23 24 25 |
# File 'lib/thailand/province.rb', line 23 def subregion_class District end |