Class: Hatenablog::Feed
- Inherits:
-
Object
- Object
- Hatenablog::Feed
- Defined in:
- lib/hatenablog/feed.rb
Instance Attribute Summary collapse
-
#author_name ⇒ Object
readonly
Returns the value of attribute author_name.
-
#next_uri ⇒ Object
readonly
Returns the value of attribute next_uri.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Class Method Summary collapse
-
.load_xml(xml) ⇒ Hatenablog::Feed
Create a new blog feed from a XML string.
Instance Method Summary collapse
- #each_entry ⇒ Object
- #entries ⇒ Array
-
#has_next? ⇒ Boolean
Return true if this feed has next feed.
Instance Attribute Details
#author_name ⇒ Object (readonly)
Returns the value of attribute author_name.
8 9 10 |
# File 'lib/hatenablog/feed.rb', line 8 def @author_name end |
#next_uri ⇒ Object (readonly)
Returns the value of attribute next_uri.
8 9 10 |
# File 'lib/hatenablog/feed.rb', line 8 def next_uri @next_uri end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/hatenablog/feed.rb', line 8 def title @title end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
8 9 10 |
# File 'lib/hatenablog/feed.rb', line 8 def updated @updated end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/hatenablog/feed.rb', line 8 def uri @uri end |
Class Method Details
.load_xml(xml) ⇒ Hatenablog::Feed
Create a new blog feed from a XML string.
13 14 15 |
# File 'lib/hatenablog/feed.rb', line 13 def self.load_xml(xml) Hatenablog::Feed.new(xml) end |
Instance Method Details
#each_entry ⇒ Object
22 23 24 25 26 |
# File 'lib/hatenablog/feed.rb', line 22 def each_entry @entries.each do |entry| yield entry end end |
#entries ⇒ Array
18 19 20 |
# File 'lib/hatenablog/feed.rb', line 18 def entries @entries.dup end |
#has_next? ⇒ Boolean
Return true if this feed has next feed.
30 31 32 |
# File 'lib/hatenablog/feed.rb', line 30 def has_next? @next_uri != '' end |