Sha256: eb8a5228588cd57edadf17b974c9091807c349699f9b0fa6f78c2acb8f3790fc

Contents?: true

Size: 1.08 KB

Versions: 22

Compression:

Stored size: 1.08 KB

Contents

module PagSeguro
  class Address
    include ActiveModel::Validations
    validates_presence_of :postal_code, :street, :number
    validates_presence_of :district, :city, :state, :country

    validates_length_of :country, is: 3
    validates_length_of :state, is: 2
    validates_length_of :postal_code, is: 8
    # Set the postal_code.
    # 8 digit number represeting a valid CEP i.e 01452002
    attr_accessor :postal_code

    # Set the street name.
    attr_accessor :street

    # Set the number.
    attr_accessor :number

    # Get the complement.
    attr_accessor :complement

    # Get the district.
    attr_accessor :district

    # Get the city.
    attr_accessor :city

    # Get the state.
    attr_accessor :state

    # Get the country.
    attr_accessor :country

    def initialize(options = {})
      @country = "BRA"
      @postal_code = options[:postal_code]
      @street = options[:street]
      @number = options[:number]
      @complement = options[:complement]
      @district = options[:district]
      @city = options[:city]
      @state = options[:state]
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pagseguro-transparente-1.1.0 lib/pagseguro/address.rb
pagseguro-transparente-1.0.1 lib/pagseguro/address.rb
pagseguro-transparente-1.0.0 lib/pagseguro/address.rb
pagseguro-transparente-0.2.5 lib/pagseguro/address.rb
pagseguro-transparente-0.2.4 lib/pagseguro/address.rb
pagseguro-transparente-0.2.3 lib/pagseguro/address.rb
pagseguro-transparente-0.2.2 lib/pagseguro/address.rb
pagseguro-transparente-0.2.1 lib/pagseguro/address.rb
pagseguro-transparente-0.2.0 lib/pagseguro/address.rb
pagseguro-transparente-0.1.3 lib/pagseguro/address.rb
pagseguro-transparente-0.1.2 lib/pagseguro/address.rb
pagseguro-transparente-0.1.1 lib/pagseguro/address.rb
pagseguro-transparente-0.1.0 lib/pagseguro/address.rb
pagseguro-transparente-0.0.9 lib/pagseguro/address.rb
pagseguro-transparente-0.0.8 lib/pagseguro/address.rb
pagseguro-transparente-0.0.7 lib/pagseguro/address.rb
pagseguro-transparente-0.0.6 lib/pagseguro/address.rb
pagseguro-transparente-0.0.5 lib/pagseguro/address.rb
pagseguro-transparente-0.0.4 lib/pagseguro/address.rb
pagseguro-transparente-0.0.3 lib/pagseguro/address.rb