Class: Cetustek::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



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

def initialize
  @environment = :sandbox
end

Instance Attribute Details

#environmentObject

logger is opt-in: nil means this gem writes nothing anywhere.



6
7
8
# File 'lib/cetustek/configuration.rb', line 6

def environment
  @environment
end

#loggerObject

logger is opt-in: nil means this gem writes nothing anywhere.



6
7
8
# File 'lib/cetustek/configuration.rb', line 6

def logger
  @logger
end

#passwordObject

logger is opt-in: nil means this gem writes nothing anywhere.



6
7
8
# File 'lib/cetustek/configuration.rb', line 6

def password
  @password
end

#site_idObject

logger is opt-in: nil means this gem writes nothing anywhere.



6
7
8
# File 'lib/cetustek/configuration.rb', line 6

def site_id
  @site_id
end

#usernameObject

logger is opt-in: nil means this gem writes nothing anywhere.



6
7
8
# File 'lib/cetustek/configuration.rb', line 6

def username
  @username
end

Instance Method Details

#production?Boolean

Returns:

  • (Boolean)


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

def production?
  @environment == :production
end

#sandbox?Boolean

Returns:

  • (Boolean)


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

def sandbox?
  @environment == :sandbox
end

#urlObject



12
13
14
15
16
17
18
# File 'lib/cetustek/configuration.rb', line 12

def url
  if @environment == :production
    'https://www.ei.com.tw/InvoiceMultiWeb/InvoiceAPI?wsdl'
  else
    'https://invoice.cetustek.com.tw/InvoiceMultiWeb/InvoiceAPI?wsdl'
  end
end