Class: Katapaty::Configuration

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

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

#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



18
19
20
21
22
23
# File 'lib/katapaty/configuration.rb', line 18

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



13
14
15
16
# File 'lib/katapaty/configuration.rb', line 13

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