Class: AsciiArtist::Art
- Inherits:
-
Object
- Object
- AsciiArtist::Art
- Defined in:
- lib/art.rb
Constant Summary collapse
- @@all =
[]
- @@favorites =
[]
Instance Attribute Summary collapse
-
#art_text ⇒ Object
Returns the value of attribute art_text.
-
#index ⇒ Object
Returns the value of attribute index.
Class Method Summary collapse
Instance Method Summary collapse
- #add_to_favorites ⇒ Object
-
#initialize(art, index) ⇒ Art
constructor
A new instance of Art.
Constructor Details
#initialize(art, index) ⇒ Art
Returns a new instance of Art.
7 8 9 10 11 |
# File 'lib/art.rb', line 7 def initialize(art, index) @art_text = art @index = index @@all << self end |
Instance Attribute Details
#art_text ⇒ Object
Returns the value of attribute art_text.
3 4 5 |
# File 'lib/art.rb', line 3 def art_text @art_text end |
#index ⇒ Object
Returns the value of attribute index.
3 4 5 |
# File 'lib/art.rb', line 3 def index @index end |
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/art.rb', line 13 def self.all @@all end |
.clear ⇒ Object
17 18 19 |
# File 'lib/art.rb', line 17 def self.clear @@all = [] end |
Instance Method Details
#add_to_favorites ⇒ Object
21 22 23 |
# File 'lib/art.rb', line 21 def add_to_favorites @@favorites << self end |