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.



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

def author_name
  @author_name
end

#next_uriObject (readonly)

Returns the value of attribute next_uri.



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

def next_uri
  @next_uri
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#updatedObject (readonly)

Returns the value of attribute updated.



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

def updated
  @updated
end

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

Parameters:

  • xml (String)

    XML string representation

Returns:



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

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

Instance Method Details

#each_entryObject



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

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

#entriesArray

Returns:

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

Returns:

  • (Boolean)


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

def has_next?
  @next_uri != ''
end