Sha256: e302e92ff645d657817a437ae5e81ea466106d9a385aed88e4781db02364005a

Contents?: true

Size: 436 Bytes

Versions: 3

Compression:

Stored size: 436 Bytes

Contents

module PostmonRuby
  class Address
    @@address_attributes = [ :complemento, :bairro, :cidade, :logradouro, :estado, :cep ]

    attr_reader :not_found, *@@address_attributes

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

    private
    attr_writer *@@address_attributes
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
postmon_ruby-2.0.0 lib/postmon_ruby/address.rb
postmon_ruby-1.0.1 lib/postmon_ruby/address.rb
postmon_ruby-1.0.0 lib/postmon_ruby/address.rb