Class: TinyHNews::Story
- Inherits:
-
Object
- Object
- TinyHNews::Story
- Defined in:
- lib/tiny_hnews/story.rb
Instance Attribute Summary collapse
-
#article ⇒ Object
readonly
Returns the value of attribute article.
-
#by ⇒ Object
readonly
Returns the value of attribute by.
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#descendants ⇒ Object
readonly
Returns the value of attribute descendants.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#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.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(id:, comments_depth: 2, comments_limit: 10) ⇒ Story
constructor
A new instance of Story.
- #wrap ⇒ Object
Constructor Details
#initialize(id:, comments_depth: 2, comments_limit: 10) ⇒ Story
Returns a new instance of Story.
5 6 7 8 9 |
# File 'lib/tiny_hnews/story.rb', line 5 def initialize(id:, comments_depth: 2, comments_limit: 10) @id = id @comments_depth = comments_depth @comments_limit = comments_limit end |
Instance Attribute Details
#article ⇒ Object (readonly)
Returns the value of attribute article.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def article @article end |
#by ⇒ Object (readonly)
Returns the value of attribute by.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def by @by end |
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def comments @comments end |
#descendants ⇒ Object (readonly)
Returns the value of attribute descendants.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def descendants @descendants end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def id @id end |
#kids ⇒ Object (readonly)
Returns the value of attribute kids.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def kids @kids end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def score @score end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def text @text end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def time @time end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/tiny_hnews/story.rb', line 3 def url @url end |
Instance Method Details
#wrap ⇒ Object
11 12 13 14 15 16 |
# File 'lib/tiny_hnews/story.rb', line 11 def wrap fetch scrap load_comments self end |