Class: Hacker::News::Comment
Overview
A comment on a story, poll, or parent comment.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#kids ⇒ Object
readonly
Returns the value of attribute kids.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Item
Instance Method Summary collapse
Methods inherited from Item
Constructor Details
This class inherits a constructor from Hacker::News::Item
Instance Attribute Details
#kids ⇒ Object (readonly)
Returns the value of attribute kids.
76 77 78 |
# File 'lib/hacker/news/items.rb', line 76 def kids @kids end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
76 77 78 |
# File 'lib/hacker/news/items.rb', line 76 def parent @parent end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
76 77 78 |
# File 'lib/hacker/news/items.rb', line 76 def text @text end |
Instance Method Details
#assign(h) ⇒ Object
78 79 80 81 82 |
# File 'lib/hacker/news/items.rb', line 78 def assign(h) @parent = h['parent'] @text = h['text'] @kids = h['kids'] || [] end |