Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Amphibian
- attr_accessor :name, :swim, :spawns
- def initialize(name, swim, spawns)
- @name = name
- @swim = swim
- @spawns = spawns
- end
- def description
- puts "I am #{@name}, and I am an amphibian! I swim, and I spawn to make babies #{@spawns}"
- end
- end
- class Frog < Amphibian
- def initialize(name, swim, spawns)
- super(name, swim, spawns)
- end
- def description
- super + " Croak!"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement