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.
9 10 11 |
# File 'lib/hatenablog/feed.rb', line 9 def @author_name end |
#next_uri ⇒ Object (readonly)
Returns the value of attribute next_uri.
9 10 11 |
# File 'lib/hatenablog/feed.rb', line 9 def next_uri @next_uri end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/hatenablog/feed.rb', line 9 def title @title end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
9 10 11 |
# File 'lib/hatenablog/feed.rb', line 9 def updated @updated end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
9 10 11 |
# File 'lib/hatenablog/feed.rb', line 9 def uri @uri end |
Class Method Details
.load_xml(xml) ⇒ Hatenablog::Feed
Create a new blog feed from a XML string.
14 15 16 |
# File 'lib/hatenablog/feed.rb', line 14 def self.load_xml(xml) Hatenablog::Feed.new(xml) end |
Instance Method Details
#each_entry ⇒ Object
23 24 25 26 27 |
# File 'lib/hatenablog/feed.rb', line 23 def each_entry @entries.each do |entry| yield entry end end |
#entries ⇒ Array
19 20 21 |
# File 'lib/hatenablog/feed.rb', line 19 def entries @entries.dup end |
#has_next? ⇒ Boolean
Return true if this feed has next feed.
31 32 33 |
# File 'lib/hatenablog/feed.rb', line 31 def has_next? @next_uri != '' end |