lib/policymap_wrap/client.rb in policymap_wrap-0.3.3 vs lib/policymap_wrap/client.rb in policymap_wrap-0.3.4

- old
+ new

@@ -24,11 +24,11 @@ @@default_options = nil class << self def set_credentials(client_id, username, password) - @@default_options = { :id => client_id, :ty => 'data', :f => 'j' } + @@default_options = { :id => client_id, :ty => 'data', :f => 'j', :af => '1' } @@connection = Connection.new(client_id, username, password) @@connection.debug = @@debug true end @@ -109,15 +109,10 @@ options = default_options.merge(options) result = get(Endpoint.endpoint_url, options) HashUtils.recursively_symbolize_keys(result["ind"]) end - - def get(endpoint, data=nil) - raise NoConnectionEstablished if @@connection.nil? - @@connection.get endpoint, data - end def containment_search(*args) default_options = @@default_options default_options[:t] = "cnt" @@ -132,9 +127,14 @@ options = default_options.merge(options) result = get(Endpoint.endpoint_url, options) result['cnt'].first + end + + def get(endpoint, data=nil) + raise NoConnectionEstablished if @@connection.nil? + @@connection.get endpoint, data end private def extract_options!(args)