Class: HackernewsApi::PollOpt
- Inherits:
-
Object
- Object
- HackernewsApi::PollOpt
- Defined in:
- lib/hackernews_api/poll_opt.rb
Instance Attribute Summary collapse
-
#by ⇒ Object
readonly
Returns the value of attribute by.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ PollOpt
constructor
A new instance of PollOpt.
Constructor Details
#initialize(json) ⇒ PollOpt
Returns a new instance of PollOpt.
10 11 12 13 14 15 16 17 |
# File 'lib/hackernews_api/poll_opt.rb', line 10 def initialize json @id = json['id'] @by = json['by'] @time = DateTime.strptime(json['time'].to_s, '%s') @type = json['type'] @parent = json['parent'] @text = json['text'] end |
Instance Attribute Details
#by ⇒ Object (readonly)
Returns the value of attribute by.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def by @by end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def id @id end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def parent @parent end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def score @score end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def text @text end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def time @time end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/hackernews_api/poll_opt.rb', line 8 def type @type end |