Class: Avmtrf1::Red::Client
- Inherits:
-
Object
- Object
- Avmtrf1::Red::Client
- Includes:
- Helper
- Defined in:
- lib/avmtrf1/red/client.rb
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#login ⇒ Object
readonly
Returns the value of attribute login.
-
#nome_maquina ⇒ Object
readonly
Returns the value of attribute nome_maquina.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#sistema ⇒ Object
readonly
Returns the value of attribute sistema.
Class Method Summary collapse
Instance Method Summary collapse
- #authorization_url ⇒ Object
-
#initialize(server, parametros) ⇒ Client
constructor
A new instance of Client.
Methods included from Helper
#check_request_result, #http_client, #post, #post_xml, #xml_content, #xml_path
Constructor Details
#initialize(server, parametros) ⇒ Client
Returns a new instance of Client.
24 25 26 27 28 29 30 |
# File 'lib/avmtrf1/red/client.rb', line 24 def initialize(server, parametros) @server = server @login = parametros.fetch('login') @ip = parametros.fetch('ip') @sistema = parametros.fetch('sistema') @nome_maquina = parametros.fetch('nomeMaquina') end |
Instance Attribute Details
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
22 23 24 |
# File 'lib/avmtrf1/red/client.rb', line 22 def ip @ip end |
#login ⇒ Object (readonly)
Returns the value of attribute login.
22 23 24 |
# File 'lib/avmtrf1/red/client.rb', line 22 def login @login end |
#nome_maquina ⇒ Object (readonly)
Returns the value of attribute nome_maquina.
22 23 24 |
# File 'lib/avmtrf1/red/client.rb', line 22 def nome_maquina @nome_maquina end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
22 23 24 |
# File 'lib/avmtrf1/red/client.rb', line 22 def server @server end |
#sistema ⇒ Object (readonly)
Returns the value of attribute sistema.
22 23 24 |
# File 'lib/avmtrf1/red/client.rb', line 22 def sistema @sistema end |
Class Method Details
Instance Method Details
#authorization_url ⇒ Object
32 33 34 35 |
# File 'lib/avmtrf1/red/client.rb', line 32 def xml = post_xml('/REDCentral/autorizacaoinclusao', xml_content('authorization')) xml.at_xpath('/root/retornoSolicitacaoInclusao/@url') end |