Class: Avmtrf1::Red::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/avmtrf1/red/server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Server

Returns a new instance of Server.



16
17
18
# File 'lib/avmtrf1/red/server.rb', line 16

def initialize(host)
  @host = host
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



14
15
16
# File 'lib/avmtrf1/red/server.rb', line 14

def host
  @host
end

Class Method Details

.by_ini_profile(ini_profile) ⇒ Object



9
10
11
# File 'lib/avmtrf1/red/server.rb', line 9

def by_ini_profile(ini_profile)
  new(ini_profile.fetch('red.server'))
end

Instance Method Details

#client(login, ip, sistema, nome_maquina) ⇒ Object



20
21
22
# File 'lib/avmtrf1/red/server.rb', line 20

def client(, ip, sistema, nome_maquina)
  ::Avmtrf1::Red::Client.new(self, , ip, sistema, nome_maquina)
end

#resource_url(url_suffix) ⇒ Object



28
29
30
# File 'lib/avmtrf1/red/server.rb', line 28

def resource_url(url_suffix)
  "#{root_url}#{url_suffix}"
end

#root_urlObject



24
25
26
# File 'lib/avmtrf1/red/server.rb', line 24

def root_url
  "http://#{host}"
end