class Agaon::Client
Constants
- API_BASE
Attributes
company_href[RW]
email[RW]
password[RW]
Public Class Methods
new(email, password, company_href=nil)
click to toggle source
# File lib/agaon/client.rb, line 13 def initialize(email, password, company_href=nil) @email = email @password = password @company_href = company_href end
Public Instance Methods
current_company()
click to toggle source
# File lib/agaon/client.rb, line 26 def current_company get_company(@company_href) end
get_company(href)
click to toggle source
# File lib/agaon/client.rb, line 30 def get_company(href) response = get(href) response.to_hash end
search(object)
click to toggle source
# File lib/agaon/client.rb, line 93 def search(object) endpoint = 'search' url = self.company_href + '/' + endpoint response = post(url,object) response._embedded.first.last.collect{|c|c.to_hash.merge('href' => c._links['self'].to_s) } end
who_am_i()
click to toggle source
# File lib/agaon/client.rb, line 19 def who_am_i url = API_BASE + '/whoAmI' response = get(url) response.to_hash end