Module: Twitter::REST::Utils

Defined in:
lib/twitter/ratelimit/patch.rb

Instance Method Summary collapse

Instance Method Details

#perform_request_with_objects(request_method, path, options, klass) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/twitter/ratelimit/patch.rb', line 18

def perform_request_with_objects(request_method, path, options, klass)
  pr = perform_request(request_method, path, options)
  collected = pr.collect do |element|
    klass.new(element)
  end
  collected.define_singleton_method :rate_limit do
    pr.rate_limit
  end
  collected
end