Class: MyRubyGem::Dog

Inherits:
Pet
  • Object
show all
Defined in:
lib/myRubyGem.rb

Instance Method Summary collapse

Methods inherited from Pet

#showColor, #showGender, #showName

Constructor Details

#initialize(name, gender, color, sound) ⇒ Dog

Returns a new instance of Dog.



23
24
25
26
# File 'lib/myRubyGem.rb', line 23

def initialize(name, gender, color, sound)
  super(name, gender, color)
  @sound = sound
end

Instance Method Details

#barkObject



28
29
30
# File 'lib/myRubyGem.rb', line 28

def bark
  puts "Dog #{@sound}"
end