Class: AriaRestClient

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/aria_sdk/aria_rest_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_no, auth_key, url) ⇒ AriaRestClient

Returns a new instance of AriaRestClient.



9
10
11
12
13
# File 'lib/aria_sdk/aria_rest_client.rb', line 9

def initialize(client_no, auth_key, url)
    self.client_no = client_no
    self.auth_key = auth_key
    self.url = url
end

Instance Attribute Details

#auth_keyObject

Returns the value of attribute auth_key.



7
8
9
# File 'lib/aria_sdk/aria_rest_client.rb', line 7

def auth_key
  @auth_key
end

#client_noObject

Returns the value of attribute client_no.



7
8
9
# File 'lib/aria_sdk/aria_rest_client.rb', line 7

def client_no
  @client_no
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/aria_sdk/aria_rest_client.rb', line 7

def url
  @url
end

Instance Method Details

#call(api_name, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/aria_sdk/aria_rest_client.rb', line 15

def call(api_name, options = {})

    defaults = {
        :output_format => 'json',
        :client_no => self.client_no,
        :auth_key => self.auth_key,
        :rest_call => api_name
    }

    options.merge!(defaults)

    result = self.class.post(self.url, :body => options)

    return result
end