Class: Cetustek::Configuration
- Inherits:
-
Object
- Object
- Cetustek::Configuration
- Defined in:
- lib/cetustek/configuration.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#password ⇒ Object
Returns the value of attribute password.
-
#site_id ⇒ Object
Returns the value of attribute site_id.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #production? ⇒ Boolean
- #sandbox? ⇒ Boolean
- #url ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/cetustek/configuration.rb', line 7 def initialize @environment = :sandbox end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/cetustek/configuration.rb', line 5 def environment @environment end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/cetustek/configuration.rb', line 5 def password @password end |
#site_id ⇒ Object
Returns the value of attribute site_id.
5 6 7 |
# File 'lib/cetustek/configuration.rb', line 5 def site_id @site_id end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/cetustek/configuration.rb', line 5 def username @username end |
Instance Method Details
#production? ⇒ Boolean
19 20 21 |
# File 'lib/cetustek/configuration.rb', line 19 def production? @environment == :production end |
#sandbox? ⇒ Boolean
23 24 25 |
# File 'lib/cetustek/configuration.rb', line 23 def sandbox? @environment == :sandbox end |
#url ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/cetustek/configuration.rb', line 11 def url if @environment == :production 'https://www.ei.com.tw/InvoiceMultiWeb/InvoiceAPI?wsdl' else 'https://invoice.cetustek.com.tw/InvoiceMultiWeb/InvoiceAPI?wsdl' end end |