Class: HackerNews::Comment
- Inherits:
-
Object
- Object
- HackerNews::Comment
- Defined in:
- lib/hn/models/comment.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#id ⇒ Object
Returns the value of attribute id.
-
#level ⇒ Object
Returns the value of attribute level.
-
#time_string ⇒ Object
Returns the value of attribute time_string.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize {|_self| ... } ⇒ Comment
Returns a new instance of Comment.
5 6 7 8 |
# File 'lib/hn/models/comment.rb', line 5 def initialize @children = [] yield self if block_given? end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
3 4 5 |
# File 'lib/hn/models/comment.rb', line 3 def children @children end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/hn/models/comment.rb', line 3 def id @id end |
#level ⇒ Object
Returns the value of attribute level.
3 4 5 |
# File 'lib/hn/models/comment.rb', line 3 def level @level end |
#time_string ⇒ Object
Returns the value of attribute time_string.
3 4 5 |
# File 'lib/hn/models/comment.rb', line 3 def time_string @time_string end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/hn/models/comment.rb', line 3 def username @username end |