Class: Delicious::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/delicious/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 “‘

Yields:

  • (_self)

Yield Parameters:



18
19
20
# File 'lib/delicious/client.rb', line 18

def initialize(&block)
  yield(self) if block_given?
end

Instance Attribute Details

#access_tokenObject

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

#bookmarksBookmarks::Api

Returns:



23
24
25
# File 'lib/delicious/client.rb', line 23

def bookmarks
  @bookmarks ||= Bookmarks::Api.new(self)
end

#bundlesBundles::Api

Returns:



28
29
30
# File 'lib/delicious/client.rb', line 28

def bundles
  @bundles ||= Bundles::Api.new(self)
end

#connectionFaraday::Connection

Returns:

  • (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

#tagsTags::Api

Returns:



33
34
35
# File 'lib/delicious/client.rb', line 33

def tags
  @tags ||= Tags::Api.new(self)
end