Class: Katapaty::Configuration

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

Constant Summary collapse

DEFAULT_TIMEOUT_IN_SECONDS =
120

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#block_hostObject

Returns the value of attribute block_host.



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

def block_host
  @block_host
end

#block_passwordObject

Returns the value of attribute block_password.



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

def block_password
  @block_password
end

#block_portObject

Returns the value of attribute block_port.



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

def block_port
  @block_port
end

#block_usernameObject

Returns the value of attribute block_username.



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

def block_username
  @block_username
end

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#portObject

Returns the value of attribute port.



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

def port
  @port
end

#sslObject

Returns the value of attribute ssl.



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

def ssl
  @ssl
end

#timeoutObject

Returns the value of attribute timeout.



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

def timeout
  @timeout
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#counterblock_urlObject



21
22
23
24
25
26
# File 'lib/katapaty/configuration.rb', line 21

def counterblock_url
  return 'http://rpc:[email protected]:14100/api/' unless @block_host
  authen = ''
  authen = "#{@block_username}:#{CGI.escape(@block_password)}@" if @block_username
  "#{protocol}://#{authen}#{@block_host}:#{@block_port}/api/"
end

#counterparty_urlObject



16
17
18
19
# File 'lib/katapaty/configuration.rb', line 16

def counterparty_url
  return 'http://rpc:[email protected]:14000/api/' unless @host
  "#{protocol}://#{@username}:#{CGI.escape(@password)}@#{@host}:#{@port}/api/"
end