Class: Fish

Inherits:
Object
  • Object
show all
Defined in:
lib/fish_finder/fish.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description) ⇒ Fish

Returns a new instance of Fish.



6
7
8
9
10
# File 'lib/fish_finder/fish.rb', line 6

def initialize(name, description)
  @name = name
  @@all << self
  @description = description
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/fish_finder/fish.rb', line 2

def description
  @description
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/fish_finder/fish.rb', line 2

def name
  @name
end

Class Method Details

.allObject



13
14
15
# File 'lib/fish_finder/fish.rb', line 13

def self.all
  @@all
end