Class: Plurky::Client
- Inherits:
-
Object
- Object
- Plurky::Client
- Includes:
- API, Configurable
- Defined in:
- lib/plurky/client.rb
Overview
Wrapper for the Plurk API 2.0
Instance Attribute Summary
Attributes included from Configurable
#consumer_key, #consumer_secret, #oauth_token, #oauth_token_secret
Instance Method Summary collapse
-
#get(path, params = {}) ⇒ Object
Perform an HTTP GET request.
-
#initialize(options = {}) ⇒ Plurky::Client
constructor
Initializes a new Client object.
-
#post(path, params = {}) ⇒ Object
Perform an HTTP POST request.
Methods included from Configurable
#cache_key, #configure, #credentials?, keys, #reset!
Methods included from API::Timeline
Constructor Details
#initialize(options = {}) ⇒ Plurky::Client
Initializes a new Client object
17 18 19 20 21 |
# File 'lib/plurky/client.rb', line 17 def initialize( = {}) Plurky::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", [key] || Plurky.instance_variable_get(:"@#{key}")) end end |
Instance Method Details
#get(path, params = {}) ⇒ Object
Perform an HTTP GET request
24 25 26 |
# File 'lib/plurky/client.rb', line 24 def get(path, params = {}) request(:get, path, params) end |
#post(path, params = {}) ⇒ Object
Perform an HTTP POST request
29 30 31 |
# File 'lib/plurky/client.rb', line 29 def post(path, params = {}) request(:post, path, params) end |