Sha256: da73297c583580d7590435da437d24eed967351b5db4ce7e64fbf5388c3614b4

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

require 'opennorth/represent/models/representatives'

module Opennorth
  class Represent
    class PostalCode < Fog::Model
      identity  :code,     type: :string
      attribute :province, type: :string
      attribute :city,     type: :string

      attribute :representatives, type: :array, aliases: %w(representatives_centroid)

      def representatives=(representative_set)
        attributes[:representatives] ||= Opennorth::Represent::Representatives.new(service: service)

        self.representatives.clear
        self.representatives.load(representative_set)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opennorth-represent-0.1.0 lib/opennorth/represent/models/postal_code.rb