Class: Category
- Inherits:
-
Object
- Object
- Category
- Defined in:
- lib/nyt_bestsellers_cli_gem/category.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#books ⇒ Object
Returns the value of attribute books.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(name) ⇒ Category
Returns a new instance of Category.
7 8 9 10 11 |
# File 'lib/nyt_bestsellers_cli_gem/category.rb', line 7 def initialize(name) @name = name @books = [] @@all << self end |
Instance Attribute Details
#books ⇒ Object
Returns the value of attribute books.
3 4 5 |
# File 'lib/nyt_bestsellers_cli_gem/category.rb', line 3 def books @books end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/nyt_bestsellers_cli_gem/category.rb', line 3 def name @name end |
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/nyt_bestsellers_cli_gem/category.rb', line 13 def self.all @@all end |