Class: RubyHackernews::CommentsInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-hackernews/domain/entry/comments_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(count, page) ⇒ CommentsInfo

Returns a new instance of CommentsInfo.



8
9
10
11
# File 'lib/ruby-hackernews/domain/entry/comments_info.rb', line 8

def initialize(count, page)
  @count = count
  @page  = page
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



5
6
7
# File 'lib/ruby-hackernews/domain/entry/comments_info.rb', line 5

def count
  @count
end

#pageObject (readonly)

Returns the value of attribute page.



6
7
8
# File 'lib/ruby-hackernews/domain/entry/comments_info.rb', line 6

def page
  @page
end

Instance Method Details

#idObject



13
14
15
# File 'lib/ruby-hackernews/domain/entry/comments_info.rb', line 13

def id  
  return page[/\d+/]
end

#urlObject



17
18
19
# File 'lib/ruby-hackernews/domain/entry/comments_info.rb', line 17

def url
  return page
end