Class: Pilipinas::Region
Overview
Represents one of the 17 administrative regions of the Philippines.
Each Region is the top-level geographic division and contains one or more Province records.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#provinces ⇒ Array<Province>
Returns the provinces belonging to this region.
Methods inherited from Base
#==, all, assoc_collection, count, find_by, find_by_code, find_by_name, first, #hash, #initialize, #inspect, last, method_missing, reset_cache, respond_to_missing?, #to_s
Constructor Details
This class inherits a constructor from Pilipinas::Base
Instance Method Details
#provinces ⇒ Array<Province>
Returns the provinces belonging to this region.
Results are cached after the first call.
19 20 21 |
# File 'lib/pilipinas/region.rb', line 19 def provinces Province.assoc_collection(code: code, dir: :regions) end |