Class: RubyIsds::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

Parameters:

  • the value to set the attribute api_url to.



3
4
5
# File 'lib/ruby_isds/configuration.rb', line 3

def api_url=(value)
  @api_url = value
end

#data_boxObject

Raises:



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

#envObject

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

#passwordObject

Raises:



22
23
24
25
# File 'lib/ruby_isds/configuration.rb', line 22

def password
  raise ConfigNotSet, 'password' unless @password
  @password
end

#usernameObject

Raises:



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_domainObject



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_urlObject



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