Class: StarWarsComics::Series
- Inherits:
-
Object
- Object
- StarWarsComics::Series
- Extended by:
- Concerns::Findable
- Defined in:
- lib/star-wars-comics/series.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#issues ⇒ Object
Returns the value of attribute issues.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#stories ⇒ Object
Returns the value of attribute stories.
Class Method Summary collapse
Instance Method Summary collapse
- #add_issue(issue) ⇒ Object
-
#initialize(name = nil, path = nil) ⇒ Series
constructor
A new instance of Series.
Methods included from Concerns::Findable
find, find_by_name, find_or_create_by_name
Constructor Details
#initialize(name = nil, path = nil) ⇒ Series
Returns a new instance of Series.
7 8 9 10 11 |
# File 'lib/star-wars-comics/series.rb', line 7 def initialize(name = nil, path = nil) @name = name @path = path @issues = [] end |
Instance Attribute Details
#desc ⇒ Object
Returns the value of attribute desc.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def desc @desc end |
#end_date ⇒ Object
Returns the value of attribute end_date.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def end_date @end_date end |
#issues ⇒ Object
Returns the value of attribute issues.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def issues @issues end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def path @path end |
#start_date ⇒ Object
Returns the value of attribute start_date.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def status @status end |
#stories ⇒ Object
Returns the value of attribute stories.
4 5 6 |
# File 'lib/star-wars-comics/series.rb', line 4 def stories @stories end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/star-wars-comics/series.rb', line 18 def self.all @@all ||= StarWarsComics::Scraper::scrape_series("/wiki/Category:Canon_comics", []) end |
Instance Method Details
#add_issue(issue) ⇒ Object
13 14 15 16 |
# File 'lib/star-wars-comics/series.rb', line 13 def add_issue(issue) issue.series ||= self self.issues << issue unless self.issues.include?(issue) end |