Class: SEFAZ::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sefaz/configuration.rb

Overview

Classe base para parametrização da biblioteca

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/sefaz/configuration.rb', line 27

def initialize
  @currency_format = { delimiter: ".", separator: ",", unit: "", precision: 2, position: "before" }
  @nfe_default_logotipo_enabled = true
  @nfe_default_logotipo_path = "lib/sefaz/assets/NFe_logo.png"
  @nfe_default_logotipo_dimensions = { width: 100, height: 100 }
  @cfe_qr_code_aplicativo = "De olho na nota"
  @cfe_cMP_cod_desc = {
    "01" => "Dinheiro",
    "02" => "Cheque",
    "03" => "Cartão de Crédito",
    "04" => "Cartão de Débito",
    "05" => "Crédito Loja",
    "10" => "Vale Alimentação",
    "11" => "Vale Refeição",
    "12" => "Vale Presente",
    "13" => "Vale Combustível",
    "15" => "Boleto Bancário",
    "16" => "Depósito Bancário",
    "17" => "Pagamento Instantâneo (PIX)",
    "18" => "Transferência bancária, Carteira Digital",
    "19" => "Programa de fidelidade, Cashback, Crédito Virtual",
    "90" => "Sem pagamento",
    "99" => "Outros"
  }

  # 50mm
  @cfe_page_width_55mm = 55.mm
  @cfe_margin_55mm = 5.mm

  # 80mm
  @cfe_page_width_80mm = 80.mm
  @cfe_margin_80mm = 5.mm
end

Instance Attribute Details

#cfe_cMP_cod_descObject

Returns the value of attribute cfe_cMP_cod_desc.



17
18
19
# File 'lib/sefaz/configuration.rb', line 17

def cfe_cMP_cod_desc
  @cfe_cMP_cod_desc
end

#cfe_margin_55mmObject

Returns the value of attribute cfe_margin_55mm.



21
22
23
# File 'lib/sefaz/configuration.rb', line 21

def cfe_margin_55mm
  @cfe_margin_55mm
end

#cfe_margin_80mmObject

Returns the value of attribute cfe_margin_80mm.



25
26
27
# File 'lib/sefaz/configuration.rb', line 25

def cfe_margin_80mm
  @cfe_margin_80mm
end

#cfe_page_width_55mmObject

55mm



20
21
22
# File 'lib/sefaz/configuration.rb', line 20

def cfe_page_width_55mm
  @cfe_page_width_55mm
end

#cfe_page_width_80mmObject

80mm



24
25
26
# File 'lib/sefaz/configuration.rb', line 24

def cfe_page_width_80mm
  @cfe_page_width_80mm
end

#cfe_qr_code_aplicativoObject

CF-e (Cupom Fiscal Eletrônico)



16
17
18
# File 'lib/sefaz/configuration.rb', line 16

def cfe_qr_code_aplicativo
  @cfe_qr_code_aplicativo
end

#currency_formatObject

Configuração da formatação de valores monetários



8
9
10
# File 'lib/sefaz/configuration.rb', line 8

def currency_format
  @currency_format
end

#nfe_default_logotipo_dimensionsObject

Returns the value of attribute nfe_default_logotipo_dimensions.



13
14
15
# File 'lib/sefaz/configuration.rb', line 13

def nfe_default_logotipo_dimensions
  @nfe_default_logotipo_dimensions
end

#nfe_default_logotipo_enabledObject

Configuração do DANFE



11
12
13
# File 'lib/sefaz/configuration.rb', line 11

def nfe_default_logotipo_enabled
  @nfe_default_logotipo_enabled
end

#nfe_default_logotipo_pathObject

Returns the value of attribute nfe_default_logotipo_path.



12
13
14
# File 'lib/sefaz/configuration.rb', line 12

def nfe_default_logotipo_path
  @nfe_default_logotipo_path
end

Class Method Details

.defaultObject



61
62
63
# File 'lib/sefaz/configuration.rb', line 61

def self.default
  @default ||= Configuration.new
end