Class: RubyIsds::Configuration
- Inherits:
-
Object
- Object
- RubyIsds::Configuration
- Defined in:
- lib/ruby_isds/configuration.rb
Instance Attribute Summary collapse
-
#api_url ⇒ Object
writeonly
Sets the attribute api_url.
- #data_box ⇒ Object
-
#env ⇒ Object
env values: :development (default) :production.
- #password ⇒ Object
- #username ⇒ Object
Instance Method Summary collapse
- #api_domain ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #xml_url ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 |
# File 'lib/ruby_isds/configuration.rb', line 5 def initialize @username = nil @password = nil @data_box = nil @env = nil end |
Instance Attribute Details
#api_url=(value) ⇒ Object (writeonly)
Sets the attribute api_url
3 4 5 |
# File 'lib/ruby_isds/configuration.rb', line 3 def api_url=(value) @api_url = value end |
#data_box ⇒ Object
12 13 14 15 |
# File 'lib/ruby_isds/configuration.rb', line 12 def data_box raise ConfigNotSet, 'data_box' unless @data_box @data_box end |
#env ⇒ Object
env values:
:development (default)
:production
32 33 34 35 |
# File 'lib/ruby_isds/configuration.rb', line 32 def env return :development unless @env @env end |
#password ⇒ Object
22 23 24 25 |
# File 'lib/ruby_isds/configuration.rb', line 22 def password raise ConfigNotSet, 'password' unless @password @password end |
#username ⇒ Object
17 18 19 20 |
# File 'lib/ruby_isds/configuration.rb', line 17 def username raise ConfigNotSet, 'username' unless @username @username end |
Instance Method Details
#api_domain ⇒ Object
37 38 39 40 41 42 |
# File 'lib/ruby_isds/configuration.rb', line 37 def api_domain case @env when :production then 'https://ws1c.mojedatovaschranka.cz' else 'https://ws1.czebox.cz' end end |
#xml_url ⇒ Object
44 45 46 47 48 49 |
# File 'lib/ruby_isds/configuration.rb', line 44 def xml_url case @env when :production then 'mojedatovaschranka.cz' else 'czechpoint.cz' end end |