lib/ruby-hackernews/domain/entry/entry.rb in ruby-hackernews-1.3.0 vs lib/ruby-hackernews/domain/entry/entry.rb in ruby-hackernews-1.3.1
- old
+ new
@@ -12,14 +12,22 @@
@link = link
@voting = voting
@user = user
@time = time
@comments_info = comments
+ @cache = PageFetcher.new(@comments_info.page)
end
+ def text
+ unless @text
+ @text = TextService.new.get_text(@cache.page)
+ end
+ return @text
+ end
+
def comments
unless @comments
- @comments = CommentService.new.get_comments(@comments_info.page)
+ @comments = CommentService.new.get_comments(@cache.page)
end
return @comments
end
def self.all(pages = 1)