Class: Ragoon::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ragoon/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint, options) ⇒ Client

Returns a new instance of Client.



4
5
6
7
# File 'lib/ragoon/client.rb', line 4

def initialize(endpoint, options)
  @endpoint = endpoint
  @options = options
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



2
3
4
# File 'lib/ragoon/client.rb', line 2

def endpoint
  @endpoint
end

#responseObject (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



9
10
11
12
13
# File 'lib/ragoon/client.rb', line 9

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, @options))
end

#resetObject



19
20
21
# File 'lib/ragoon/client.rb', line 19

def reset
  @result_set = nil
end

#result_setObject



15
16
17
# File 'lib/ragoon/client.rb', line 15

def result_set
  @result_set ||= Nokogiri::XML.parse(response.body)
end