lib/attune/api/anonymous.rb in attune-1.0.17 vs lib/attune/api/anonymous.rb in attune-1.0.18

- old
+ new

@@ -31,22 +31,22 @@ query_param_keys.include? key end headers = nil post_body = nil - #response = @client.request(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }) - #if response - # Attune::Model::AnonymousResult.new(JSON.parse(response.body)) - #else + response = @client.request(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }) + if response + Attune::Model::AnonymousResult.new(JSON.parse(response.body)) + else mockProc = MOCKS['Anonymous.create'] if mockProc mockResponse = mockProc.call() Attune::Model::AnonymousResult.new(mockResponse) else nil end - # end + end end # Binds one actor to another, allowing activities of those actors to be shared between the two. # @@ -57,15 +57,11 @@ # @raise [AuthenticationException] if authorization header not accepted def update (anonymous,body) query_param_keys = [] # verify existence of params - #raise ArgumentError, "anonymous is required" if anonymous.nil? - if anonymous == nil - anonymous = SecureRandom.uuid - end - + raise ArgumentError, "anonymous is required" if anonymous.nil? raise ArgumentError, "body is required" if body.nil? # set default values and merge with input options = { :anonymous => anonymous, :body => body} @@ -114,14 +110,10 @@ # @raise [AuthenticationException] if authorization header not accepted def get (anonymous) query_param_keys = [] # verify existence of params - # raise ArgumentError, "anonymous is required" if anonymous.nil? - if anonymous == nil - anonymous = SecureRandom.uuid - end - + raise ArgumentError, "anonymous is required" if anonymous.nil? # set default values and merge with input options = { :anonymous => anonymous} #resource path