Sha256: 98edbd641eb770953188b5bfb352f96d543af529ad9d72b07ca3d85d29388859
Contents?: true
Size: 545 Bytes
Versions: 20
Compression:
Stored size: 545 Bytes
Contents
# encoding: UTF-8 module Correios module Frete class PacoteItem attr_accessor :peso, :comprimento, :largura, :altura DEFAULT_OPTIONS = { :peso => 0.0, :comprimento => 0.0, :largura => 0.0, :altura => 0.0 } def initialize(options = {}) DEFAULT_OPTIONS.merge(options).each do |attr, value| self.send("#{attr}=", value) end yield self if block_given? end def volume @comprimento * @largura * @altura end end end end
Version data entries
20 entries across 20 versions & 1 rubygems