Class: Avmtrf1::Red::Server
- Inherits:
-
Object
- Object
- Avmtrf1::Red::Server
- Defined in:
- lib/avmtrf1/red/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Class Method Summary collapse
Instance Method Summary collapse
- #client(login, ip, sistema, nome_maquina) ⇒ Object
-
#initialize(host) ⇒ Server
constructor
A new instance of Server.
- #resource_url(url_suffix) ⇒ Object
- #root_url ⇒ Object
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
#host ⇒ Object (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(login, ip, sistema, nome_maquina) ::Avmtrf1::Red::Client.new(self, login, 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_url ⇒ Object
24 25 26 |
# File 'lib/avmtrf1/red/server.rb', line 24 def root_url "http://#{host}" end |