Class: Delicious
- Inherits:
-
Object
- Object
- Delicious
- Includes:
- REXML
- Defined in:
- lib/shinmun/aggregations/delicious.rb
Defined Under Namespace
Classes: DeliciousItem
Instance Attribute Summary collapse
-
#days ⇒ Object
Returns the value of attribute days.
-
#items ⇒ Object
Returns the value of attribute items.
-
#link ⇒ Object
Returns the value of attribute link.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, refresh = true) ⇒ Delicious
constructor
Pass the url to the RSS feed you would like to keep tabs on by default this will request the rss from the server right away and fill the items array.
-
#refresh ⇒ Object
This method lets you refresh the items in the items array useful if you keep the object cached in memory and.
Constructor Details
#initialize(url, refresh = true) ⇒ Delicious
Pass the url to the RSS feed you would like to keep tabs on by default this will request the rss from the server right away and fill the items array
18 19 20 21 22 23 |
# File 'lib/shinmun/aggregations/delicious.rb', line 18 def initialize(url, refresh = true) self.items = [] self.url = url self.days = {} self.refresh if refresh end |
Instance Attribute Details
#days ⇒ Object
Returns the value of attribute days.
8 9 10 |
# File 'lib/shinmun/aggregations/delicious.rb', line 8 def days @days end |
#items ⇒ Object
Returns the value of attribute items.
8 9 10 |
# File 'lib/shinmun/aggregations/delicious.rb', line 8 def items @items end |
#link ⇒ Object
Returns the value of attribute link.
8 9 10 |
# File 'lib/shinmun/aggregations/delicious.rb', line 8 def link @link end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/shinmun/aggregations/delicious.rb', line 8 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/shinmun/aggregations/delicious.rb', line 8 def url @url end |
Instance Method Details
#refresh ⇒ Object
This method lets you refresh the items in the items array useful if you keep the object cached in memory and
27 28 29 30 31 |
# File 'lib/shinmun/aggregations/delicious.rb', line 27 def refresh open(@url) do |http| parse(http.read) end end |