Class: Pilipinas::City

Inherits:
Base
  • Object
show all
Defined in:
lib/pilipinas/city.rb

Instance Attribute Summary

Attributes inherited from Base

#code, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

add, all, assoc_collection, count, find_by, first, #initialize, last, load_file, method_missing, parse_attributes, reset_data, select_by, validate

Constructor Details

This class inherits a constructor from Pilipinas::Base

Class Method Details

.load_dataObject



8
9
10
# File 'lib/pilipinas/city.rb', line 8

def load_data
  load_file(File.join(File.dirname(__FILE__), '..', 'data', 'cities.yml'))
end

Instance Method Details

#barangaysObject



3
4
5
# File 'lib/pilipinas/city.rb', line 3

def barangays
  Pilipinas::Barangay.assoc_collection(code: code, dir: :cities)
end