Class: PSGC::ProvinceOrDistrict
- Inherits:
-
Struct
- Object
- Struct
- PSGC::ProvinceOrDistrict
- Defined in:
- lib/psgc/province.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/psgc/province.rb', line 2 def id @id end |
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/psgc/province.rb', line 2 def name @name end |
Instance Method Details
#cities ⇒ Object
10 11 12 |
# File 'lib/psgc/province.rb', line 10 def cities @cities ||= load(cities_data, PSGC::City) || [] end |
#code ⇒ Object
3 4 5 |
# File 'lib/psgc/province.rb', line 3 def code "#{id}00000" end |
#municipalities ⇒ Object
14 15 16 |
# File 'lib/psgc/province.rb', line 14 def municipalities @municipalities ||= load(municipalities_data, PSGC::Municipality) || [] end |
#province? ⇒ Boolean
6 7 8 |
# File 'lib/psgc/province.rb', line 6 def province? is_a? Province end |