Class: Delicious::Client
- Inherits:
-
Object
- Object
- Delicious::Client
- Defined in:
- lib/delicious/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
- #bookmarks ⇒ Bookmarks::Api
- #bundles ⇒ Bundles::Api
- #connection ⇒ Faraday::Connection
-
#initialize {|_self| ... } ⇒ Client
constructor
Initializes and configures Delicious client.
- #tags ⇒ Tags::Api
Constructor Details
#initialize {|_self| ... } ⇒ Client
Initializes and configures Delicious client. The only requires configuration option for now is ‘access_token`. Example:
“‘ruby client = Delicious::Client.new do |client|
client.access_token = 'my-access-token'
end “‘
18 19 20 |
# File 'lib/delicious/client.rb', line 18 def initialize(&block) yield(self) if block_given? end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
8 9 10 |
# File 'lib/delicious/client.rb', line 8 def access_token @access_token end |
Instance Method Details
#bookmarks ⇒ Bookmarks::Api
23 24 25 |
# File 'lib/delicious/client.rb', line 23 def bookmarks @bookmarks ||= Bookmarks::Api.new(self) end |
#bundles ⇒ Bundles::Api
28 29 30 |
# File 'lib/delicious/client.rb', line 28 def bundles @bundles ||= Bundles::Api.new(self) end |
#connection ⇒ Faraday::Connection
38 39 40 41 42 43 44 |
# File 'lib/delicious/client.rb', line 38 def connection Faraday.new(url: api_endpoint, headers: headers) do |c| c.request :url_encoded c.response :xml, content_type: /\bxml$/ c.adapter Faraday.default_adapter end end |