Sha256: 37ea8ac7970fc7ef539ccc3f9034c1271a3dd381458b2b8e2b1f067933534d43

Contents?: true

Size: 701 Bytes

Versions: 21

Compression:

Stored size: 701 Bytes

Contents

module PagSeguro
  class Shipping
    include ActiveModel::Validations
    extend Forwardable

    def_delegators :address, :country, :postal_code, :street, :number
    def_delegators :address, :complement, :district, :city, :state

    validates_presence_of :address
    validates_inclusion_of :type_id, in: %w( 1 2 3 ), allow_blank: true
    validates_numericality_of :cost, greater_than: 0, allow_nil: true

    # Set the shipping type
    attr_accessor :type_id

    # Set the credit card holder bithdate.
    attr_accessor :cost

    # Get the sender address.
    attr_accessor :address

    def initialize(type_id = nil, cost = nil)
      @type_id = type_id
      @cost = cost
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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