Class: Facturapi::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/facturapi/config.rb

Instance Method Summary collapse

Instance Method Details

#fact_password(password = nil) ⇒ Object

Set and gets the default facturacion password



18
19
20
21
# File 'lib/facturapi/config.rb', line 18

def fact_password(password = nil)
  @password = password if password
  Base64.strict_encode64(@password || ENV['FACTURACION_PASSWORD'])
end

#fact_port(port = nil) ⇒ Object

Set and gets the default facturacion port



24
25
26
27
# File 'lib/facturapi/config.rb', line 24

def fact_port(port = nil)
  @port = port if port
  Base64.strict_encode64((@port || ENV['FACTURACION_PORT']).to_s)
end

#fact_rut(rut = nil) ⇒ Object

Set and gets the default facturacion rut



12
13
14
15
# File 'lib/facturapi/config.rb', line 12

def fact_rut(rut = nil)
  @rut = rut if rut
  Base64.strict_encode64(@rut || ENV['FACTURACION_RUT'])
end

#fact_user(user = nil) ⇒ Object

Set and gets the default facturacion user



6
7
8
9
# File 'lib/facturapi/config.rb', line 6

def fact_user(user = nil)
  @user = user if user
  Base64.strict_encode64(@user || ENV['FACTURACION_USER'])
end