Class: Hacker::News::PollOpt

Inherits:
Item
  • Object
show all
Defined in:
lib/hacker/news/items.rb

Overview

A single option under a Poll. poll is the parent Poll id.

Instance Attribute Summary collapse

Attributes inherited from Item

#by, #dead, #id, #time, #type

Instance Method Summary collapse

Methods inherited from Item

from_hash, #initialize

Constructor Details

This class inherits a constructor from Hacker::News::Item

Instance Attribute Details

#pollObject (readonly)

Returns the value of attribute poll.



113
114
115
# File 'lib/hacker/news/items.rb', line 113

def poll
  @poll
end

#scoreObject (readonly)

Returns the value of attribute score.



113
114
115
# File 'lib/hacker/news/items.rb', line 113

def score
  @score
end

#textObject (readonly)

Returns the value of attribute text.



113
114
115
# File 'lib/hacker/news/items.rb', line 113

def text
  @text
end

Instance Method Details

#assign(h) ⇒ Object



115
116
117
118
119
# File 'lib/hacker/news/items.rb', line 115

def assign(h)
  @poll = h['poll']
  @score = h['score']
  @text = h['text']
end