Class: Plurky::Client

Inherits:
Object
  • Object
show all
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

Methods included from Configurable

#cache_key, #configure, #credentials?, keys, #reset!

Methods included from API::Timeline

#status

Constructor Details

#initialize(options = {}) ⇒ Plurky::Client

Initializes a new Client object

Parameters:

  • options (Hash) (defaults to: {})


17
18
19
20
21
# File 'lib/plurky/client.rb', line 17

def initialize(options = {})
  Plurky::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", options[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