Class: Hatenablog::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/hatenablog/feed.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#author_nameObject (readonly)

Returns the value of attribute author_name.



8
9
10
# File 'lib/hatenablog/feed.rb', line 8

def author_name
  @author_name
end

#next_uriObject (readonly)

Returns the value of attribute next_uri.



8
9
10
# File 'lib/hatenablog/feed.rb', line 8

def next_uri
  @next_uri
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/hatenablog/feed.rb', line 8

def title
  @title
end

#updatedObject (readonly)

Returns the value of attribute updated.



8
9
10
# File 'lib/hatenablog/feed.rb', line 8

def updated
  @updated
end

#uriObject (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.

Parameters:

  • xml (String)

    XML string representation

Returns:



13
14
15
# File 'lib/hatenablog/feed.rb', line 13

def self.load_xml(xml)
  Hatenablog::Feed.new(xml)
end

Instance Method Details

#each_entryObject



22
23
24
25
26
# File 'lib/hatenablog/feed.rb', line 22

def each_entry
  @entries.each do |entry|
    yield entry
  end
end

#entriesArray

Returns:

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

Returns:

  • (Boolean)


30
31
32
# File 'lib/hatenablog/feed.rb', line 30

def has_next?
  @next_uri != ''
end