Class: Delicious_Api
- Inherits:
-
Object
- Object
- Delicious_Api
- Defined in:
- lib/graphiclious/delicious_api.rb
Overview
These are the only methods that we actually use within Graphiclious. The current implementation uses Rubilicious to realise them. This might change over time.
Instance Method Summary collapse
- #all ⇒ Object
- #bundles ⇒ Object
-
#initialize(user, password) ⇒ Delicious_Api
constructor
A new instance of Delicious_Api.
- #recent ⇒ Object
-
#timestamp ⇒ Object
This method should be used before calling #all.
Constructor Details
#initialize(user, password) ⇒ Delicious_Api
Returns a new instance of Delicious_Api.
85 86 87 88 89 |
# File 'lib/graphiclious/delicious_api.rb', line 85 def initialize(user, password) @interface = Rubilicious.new(user, password) @interface.base_uri = 'https://api.del.icio.us/v1' @interface end |
Instance Method Details
#all ⇒ Object
113 114 115 |
# File 'lib/graphiclious/delicious_api.rb', line 113 def all @interface.all end |
#bundles ⇒ Object
99 100 101 |
# File 'lib/graphiclious/delicious_api.rb', line 99 def bundles @interface.bundles end |
#recent ⇒ Object
103 104 105 106 107 108 109 110 111 |
# File 'lib/graphiclious/delicious_api.rb', line 103 def recent links = @interface.recent(nil, 25) return nil unless links # make sure that format is equal to format in #all links.each { |v| v["extended"] = "" unless v["extended"] } links end |
#timestamp ⇒ Object
This method should be used before calling #all. Store this time locally after each call of #all. Compare the stored time with the time returned by this method to decide if an update is necessary.
95 96 97 |
# File 'lib/graphiclious/delicious_api.rb', line 95 def @interface.update end |