Class: Instapaper::Client
- Inherits:
-
Object
- Object
- Instapaper::Client
- Includes:
- API, HTTP::Utils
- Defined in:
- lib/instapaper/client.rb
Overview
Wrapper for the Instapaper REST API
Instance Attribute Summary collapse
-
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
-
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
-
#oauth_token ⇒ Object
Returns the value of attribute oauth_token.
-
#oauth_token_secret ⇒ Object
Returns the value of attribute oauth_token_secret.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
- #user_agent ⇒ String
Instance Method Summary collapse
- #consumer_credentials ⇒ Hash
-
#credentials ⇒ Hash
Authentication hash.
- #credentials? ⇒ Boolean
-
#initialize(options = {}) {|_self| ... } ⇒ Instapaper::Client
constructor
Initializes a new Client object.
Methods included from API::OAuth
Methods included from API::Highlights
#add_highlight, #delete_highlight, #highlights
Methods included from API::Folders
#add_folder, #delete_folder, #folders, #set_order
Methods included from API::Bookmarks
#add_bookmark, #archive_bookmark, #bookmarks, #delete_bookmark, #get_text, #move_bookmark, #star_bookmark, #unarchive_bookmark, #unstar_bookmark, #update_read_progress
Methods included from API::Accounts
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Instapaper::Client
Initializes a new Client object
18 19 20 21 22 23 24 25 |
# File 'lib/instapaper/client.rb', line 18 def initialize( = {}) @oauth_token = [:oauth_token] @oauth_token_secret = [:oauth_token_secret] @consumer_key = [:consumer_key] @consumer_secret = [:consumer_secret] @proxy = [:proxy] yield(self) if block_given? end |
Instance Attribute Details
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
11 12 13 |
# File 'lib/instapaper/client.rb', line 11 def consumer_key @consumer_key end |
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
11 12 13 |
# File 'lib/instapaper/client.rb', line 11 def consumer_secret @consumer_secret end |
#oauth_token ⇒ Object
Returns the value of attribute oauth_token.
11 12 13 |
# File 'lib/instapaper/client.rb', line 11 def oauth_token @oauth_token end |
#oauth_token_secret ⇒ Object
Returns the value of attribute oauth_token_secret.
11 12 13 |
# File 'lib/instapaper/client.rb', line 11 def oauth_token_secret @oauth_token_secret end |
#proxy ⇒ Object
Returns the value of attribute proxy.
11 12 13 |
# File 'lib/instapaper/client.rb', line 11 def proxy @proxy end |
#user_agent ⇒ String
28 29 30 |
# File 'lib/instapaper/client.rb', line 28 def user_agent @user_agent ||= "InstapaperRubyGem/#{Instapaper::VERSION}" end |
Instance Method Details
#consumer_credentials ⇒ Hash
45 46 47 48 49 50 |
# File 'lib/instapaper/client.rb', line 45 def consumer_credentials { consumer_key: @consumer_key, consumer_secret: @consumer_secret, } end |
#credentials ⇒ Hash
Authentication hash
35 36 37 38 39 40 41 42 |
# File 'lib/instapaper/client.rb', line 35 def credentials { consumer_key: @consumer_key, consumer_secret: @consumer_secret, oauth_token: @oauth_token, oauth_token_secret: @oauth_token_secret, } end |
#credentials? ⇒ Boolean
53 54 55 |
# File 'lib/instapaper/client.rb', line 53 def credentials? credentials.values.all? end |