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) ⇒ 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

#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



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_setObject



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

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