class Jamef::Package

Constants

PRODUCTS_TYPES

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/jamef/package.rb, line 16
def initialize *args
  super
  self.type ||= :nf
  raise ArgumentError, errors.first unless self.valid?
  self
end
type_map(package_type) click to toggle source
# File lib/jamef/package.rb, line 23
def self.type_map package_type
  value = {
  
    #       CONFORME NOTA FISCAL
    nf: '000004',
    
    #       LIVROS
    livros: '000005',
    
    #       ALIMENTOS INDUSTRIALIZADOS
    alimentos: '000010',
    
    #       CONFECCOES
    confeccoes: '000008',
    
    #       COSMETICOS
    comesticos: '000011',
    
    #       MATERIAL CIRURGICO
    cirugicos: '000011',
    
    #       JORNAIS / REVISTAS
    jornais: '000006',
    
    #       MATERIAL ESCOLAR
    material_escolar: '000013'
  
  }[package_type]
  value ? value : raise(ArgumentError,"Unknown Jamef Package Type: #{package_type}")
end

Public Instance Methods

price() click to toggle source
# File lib/jamef/package.rb, line 54
def price
  package_price
end
price=(value) click to toggle source
# File lib/jamef/package.rb, line 58
def price= value
  self.package_price = value
end