Class: Story
- Inherits:
-
Object
- Object
- Story
- Defined in:
- lib/NBA_news/story.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#content ⇒ Object
Returns the value of attribute content.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Story
constructor
A new instance of Story.
Constructor Details
#initialize ⇒ Story
Returns a new instance of Story.
6 7 8 |
# File 'lib/NBA_news/story.rb', line 6 def initialize @@all << self end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
2 3 4 |
# File 'lib/NBA_news/story.rb', line 2 def @author end |
#content ⇒ Object
Returns the value of attribute content.
2 3 4 |
# File 'lib/NBA_news/story.rb', line 2 def content @content end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/NBA_news/story.rb', line 2 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/NBA_news/story.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
10 11 12 |
# File 'lib/NBA_news/story.rb', line 10 def self.all @@all end |
.find_by_author(name) ⇒ Object
18 19 20 |
# File 'lib/NBA_news/story.rb', line 18 def self.(name) self.all.find_all {|story| story. == name} end |
.list_authors ⇒ Object
14 15 16 |
# File 'lib/NBA_news/story.rb', line 14 def self. self.all.map {|story| story.} end |