Class: Ragoon::Client
- Inherits:
-
Object
- Object
- Ragoon::Client
- Defined in:
- lib/ragoon/client.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(endpoint) ⇒ Client
constructor
A new instance of Client.
- #request(action_name, body_node) ⇒ Object
- #result_set ⇒ Object
Constructor Details
#initialize(endpoint) ⇒ Client
Returns a new instance of Client.
4 5 6 |
# File 'lib/ragoon/client.rb', line 4 def initialize(endpoint) @endpoint = endpoint end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
2 3 4 |
# File 'lib/ragoon/client.rb', line 2 def endpoint @endpoint end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
2 3 4 |
# File 'lib/ragoon/client.rb', line 2 def response @response end |
Instance Method Details
#request(action_name, body_node) ⇒ Object
8 9 10 11 12 |
# File 'lib/ragoon/client.rb', line 8 def request(action_name, body_node) @action_name = action_name @body_node = body_node @response = RestClient.post(endpoint, Ragoon::XML.render(action_name, body_node)) end |
#result_set ⇒ Object
14 15 16 |
# File 'lib/ragoon/client.rb', line 14 def result_set @result_set ||= Nokogiri::XML.parse(response.body) end |