Sha256: 486e9e7674ef49b6edb562bd2a7c4be12e29c44c749412629f1798ac08154bbf

Contents?: true

Size: 483 Bytes

Versions: 9

Compression:

Stored size: 483 Bytes

Contents

class INE::Places::AutonomousRegion < OpenStruct
  include INE::Places::CSVRecord

  def provinces
    INE::Places::Province.find_all_by_autonomous_region_id(self.id)
  end

  private

  def self.collection_klass
    INE::Places::AutonomousRegionsCollection
  end

  def self.filter(records, name)
    return [] if name.blank?
    parameterized_name = name.parameterize

    records.select{|a| a.slug.include?(parameterized_name) }.
      sort_by{|a| a.name.parameterize }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ine-places-0.2.0 lib/ine/places/autonomous_region.rb
ine-places-0.1.7 lib/ine/places/autonomous_region.rb
ine-places-0.1.6 lib/ine/places/autonomous_region.rb
ine-places-0.1.5 lib/ine/places/autonomous_region.rb
ine-places-0.1.4 lib/ine/places/autonomous_region.rb
ine-places-0.1.3 lib/ine/places/autonomous_region.rb
ine-places-0.1.2 lib/ine/places/autonomous_region.rb
ine-places-0.1.1 lib/ine/places/autonomous_region.rb
ine-places-0.1.0 lib/ine/places/autonomous_region.rb