Sha256: d88b5cbe38692488204de07827d9bcf555d5689ed903f24505936c2effd4714c

Contents?: true

Size: 386 Bytes

Versions: 5

Compression:

Stored size: 386 Bytes

Contents

module PostmonRuby
  class City
    @@city_attributes = [ :area_km2, :codigo_ibge ]

    attr_reader :not_found, *@@city_attributes

    def initialize(options={})
      @not_found = true if options.nil?
      @@city_attributes.each do |attribute|
        send(:"#{attribute}=", options[attribute.to_s] || "") 
      end
    end

    private
    attr_writer *@@city_attributes
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
postmon_ruby-2.1.3 lib/postmon_ruby/city.rb
postmon_ruby-2.1.2 lib/postmon_ruby/city.rb
postmon_ruby-2.1.1 lib/postmon_ruby/city.rb
postmon_ruby-2.1.0 lib/postmon_ruby/city.rb
postmon_ruby-2.0.0 lib/postmon_ruby/city.rb