lib/ruby-hackernews/domain/entry/entry.rb in ruby-hackernews-1.1.2 vs lib/ruby-hackernews/domain/entry/entry.rb in ruby-hackernews-1.1.3
- old
+ new
@@ -1,6 +1,5 @@
-
class Entry
attr_reader :number
attr_reader :link
attr_reader :voting
@@ -43,12 +42,16 @@
end
def id
return @comments_info ? @comments_info.id : nil
end
+
+ def comments_url
+ return @comments_info ? ConfigurationService.base_url + @comments_info.url : nil
+ end
def comments_count
- return @comments_info.count
+ return @comments_info.count unless @comments_info.nil?
end
def write_comment(text)
return CommentService.new.write_comment(@comments_info.page, text)
end