Class: Hacker::News::Poll
Overview
A multiple-choice poll. parts lists the PollOpt ids in display order.
Instance Attribute Summary collapse
-
#descendants ⇒ Object
readonly
Returns the value of attribute descendants.
-
#kids ⇒ Object
readonly
Returns the value of attribute kids.
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
-
#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.
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.
99 100 101 |
# File 'lib/hacker/news/items.rb', line 99 def descendants @descendants end |
#kids ⇒ Object (readonly)
Returns the value of attribute kids.
99 100 101 |
# File 'lib/hacker/news/items.rb', line 99 def kids @kids end |
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
99 100 101 |
# File 'lib/hacker/news/items.rb', line 99 def parts @parts end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
99 100 101 |
# File 'lib/hacker/news/items.rb', line 99 def score @score end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
99 100 101 |
# File 'lib/hacker/news/items.rb', line 99 def text @text end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
99 100 101 |
# File 'lib/hacker/news/items.rb', line 99 def title @title end |
Instance Method Details
#assign(h) ⇒ Object
101 102 103 104 105 106 107 108 |
# File 'lib/hacker/news/items.rb', line 101 def assign(h) @title = h['title'] @score = h['score'] @descendants = h['descendants'] @parts = h['parts'] || [] @text = h['text'] @kids = h['kids'] || [] end |