Class: MyMoip::TransparentRequest
- Inherits:
-
Request
- Object
- Request
- MyMoip::TransparentRequest
show all
- Defined in:
- lib/mymoip/requests/transparent_request.rb
Constant Summary
collapse
- HTTP_METHOD =
:post
- PATH =
"/ws/alpha/EnviarInstrucao/Unica"
- REQUIRES_AUTH =
true
Instance Attribute Summary
Attributes inherited from Request
#response
Instance Method Summary
collapse
Methods inherited from Request
#initialize
Instance Method Details
#api_call(data, opts = {}) ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/mymoip/requests/transparent_request.rb', line 8
def api_call(data, opts = {})
params = {
body: data.to_xml,
http_method: HTTP_METHOD,
requires_auth: REQUIRES_AUTH,
path: PATH
}
super(params, opts)
end
|
#id ⇒ Object
30
31
32
33
|
# File 'lib/mymoip/requests/transparent_request.rb', line 30
def id
@response["EnviarInstrucaoUnicaResponse"]["Resposta"]["ID"]
rescue NoMethodError
end
|
#success? ⇒ Boolean
19
20
21
22
23
|
# File 'lib/mymoip/requests/transparent_request.rb', line 19
def success?
@response["EnviarInstrucaoUnicaResponse"]["Resposta"]["Status"] == "Sucesso"
rescue NoMethodError
false
end
|
#token ⇒ Object
25
26
27
28
|
# File 'lib/mymoip/requests/transparent_request.rb', line 25
def token
@response["EnviarInstrucaoUnicaResponse"]["Resposta"]["Token"]
rescue NoMethodError
end
|