Class: Livedoor::API::FeedDiscover::FeedList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/livedoor/api/feed_discover/feed_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(fetcher) ⇒ FeedList

Returns a new instance of FeedList.



7
8
9
10
11
12
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 7

def initialize(fetcher)
  @fetcher = fetcher
  @feeds = nil
  @opml = nil
  feeds0 # fetch feed information

end

Instance Method Details

#each(&block) ⇒ Object



41
42
43
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 41

def each(&block)
  feeds0.each(&block)
end


45
46
47
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 45

def each_feedlink(&block)
  feedlinks.each(&block)
end

#feedObject



23
24
25
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 23

def feed
  feeds0.first
end


31
32
33
34
35
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 31

def feedlink
  if r = feeds0.first
    r.feedlink
  end
end


37
38
39
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 37

def feedlinks
  feeds0.map{|e| e.feedlink }
end

#feedsObject



27
28
29
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 27

def feeds
  feeds0.dup
end

#feeds?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 19

def feeds?
  not feeds0.empty?
end

#opmlObject



49
50
51
52
53
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 49

def opml
  if r = opml0
    r.dup
  end
end

#sizeObject Also known as: length



14
15
16
# File 'lib/livedoor/api/feed_discover/feed_list.rb', line 14

def size
  feeds0.size
end