Class: HackerNews::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/hn/models/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Comment

Returns a new instance of Comment.

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
# File 'lib/hn/models/comment.rb', line 5

def initialize
  @children = []
  yield self if block_given?
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



3
4
5
# File 'lib/hn/models/comment.rb', line 3

def children
  @children
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/hn/models/comment.rb', line 3

def id
  @id
end

#levelObject

Returns the value of attribute level.



3
4
5
# File 'lib/hn/models/comment.rb', line 3

def level
  @level
end

#time_stringObject

Returns the value of attribute time_string.



3
4
5
# File 'lib/hn/models/comment.rb', line 3

def time_string
  @time_string
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/hn/models/comment.rb', line 3

def username
  @username
end