Sha256: f42eb0f53e1d6ffe9de252049cde762f77c6c91e6f0ee9114c6fa8c926d4d807

Contents?: true

Size: 398 Bytes

Versions: 4

Compression:

Stored size: 398 Bytes

Contents

module PostmonRuby
  class State
    @@state_attributes = [ :area_km2, :codigo_ibge, :nome ]

    attr_reader :not_found, *@@state_attributes

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

    private
    attr_writer *@@state_attributes
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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