Class: Hacker::News::Story
Overview
A submitted HN story.
Instance Attribute Summary collapse
-
#descendants ⇒ Object
readonly
Returns the value of attribute descendants.
-
#kids ⇒ Object
readonly
Returns the value of attribute kids.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
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
#descendants ⇒ Object (readonly)
Returns the value of attribute descendants.
62 63 64 |
# File 'lib/hacker/news/items.rb', line 62 def descendants @descendants end |
#kids ⇒ Object (readonly)
Returns the value of attribute kids.
62 63 64 |
# File 'lib/hacker/news/items.rb', line 62 def kids @kids end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
62 63 64 |
# File 'lib/hacker/news/items.rb', line 62 def score @score end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
62 63 64 |
# File 'lib/hacker/news/items.rb', line 62 def text @text end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
62 63 64 |
# File 'lib/hacker/news/items.rb', line 62 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
62 63 64 |
# File 'lib/hacker/news/items.rb', line 62 def url @url end |
Instance Method Details
#assign(h) ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/hacker/news/items.rb', line 64 def assign(h) @title = h['title'] @score = h['score'] @descendants = h['descendants'] @url = h['url'] @text = h['text'] @kids = h['kids'] || [] end |