Class: RubyMeetup::ApiKeyClient
Overview
This class is typically used to read data without needing to first obtain a user authenticated access_token
. We just need a valid API Key, which any one can obtain directly from www.meetup.com
The API key can be configured globally like so,
> RubyMeetup::ApiKeyClient.key = 'abcd000000000000000wxyz'
Then create a new client and make a request,
> client = RubyMeetup::ApiKeyClient.new
> json_string = client.get_path("/2/groups", {:group_id => 390230})
The same client instance may be used to make multiple requests. Just supply a different @path and/or @options parameters as required.
Copyright © 2013 Long On, released under the MIT license
Constant Summary collapse
- @@key =
""
Instance Attribute Summary
Attributes inherited from Client
Class Method Summary collapse
-
.key=(string) ⇒ Object
Set the global API Key.
Instance Method Summary collapse
-
#to_s ⇒ Object
:nodoc:.
Methods inherited from Client
#get, #get_path, #post, #post_path, site, site=
Class Method Details
.key=(string) ⇒ Object
Set the global API Key
28 29 30 |
# File 'lib/api_key_client.rb', line 28 def self.key=string @@key = string end |
Instance Method Details
#to_s ⇒ Object
:nodoc:
35 36 37 38 |
# File 'lib/api_key_client.rb', line 35 def to_s s = super s << ", key=#{short_key}" end |