Module: F00px::Request

Included in:
Client
Defined in:
lib/f00px/request.rb,
lib/f00px/request/runner.rb,
lib/f00px/request/callback.rb

Defined Under Namespace

Classes: Callback, Runner

Instance Method Summary collapse

Instance Method Details

#get(url, params = {}) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/f00px/request.rb', line 15

def get(url, params = {})
  queue do
    get(url, params).complete do |response|
      return response
    end
  end
end

#post(url, params = {}) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/f00px/request.rb', line 23

def post(url, params = {})
  queue do
    post(url, params).complete do |response|
      return response
    end
  end
end

#queue(&block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/f00px/request.rb', line 7

def queue(&block)
  queue = Request::Runner.new(connection)
  queue.user_id = user_id if user_id?
  queue.consumer_key = consumer_key if consumer_key?
  queue.instance_eval(&block)
  queue.run!
end