Class: Stackexchange::Client
- Inherits:
-
Object
- Object
- Stackexchange::Client
- Includes:
- APISmith::Client
- Defined in:
- lib/stackexchange-ruby.rb
Constant Summary collapse
- METHODS =
%w[answers questions badges comments events info posts priviligess search tags]
Instance Method Summary collapse
-
#initialize(*args) ⇒ Client
constructor
api_key.
Constructor Details
#initialize(*args) ⇒ Client
api_key
11 12 13 14 15 16 17 18 19 |
# File 'lib/stackexchange-ruby.rb', line 11 def initialize(*args) :api_key => args.shift, :site => 'stackoverflow' METHODS.each do |m| self.class.send(:define_method, m) do |*opts| resp = (get "#{m}", :extra_query => opts.shift) end end end |