S
Spitfire
These are the sequence of actions I performed in irb.
class Dumber
def sayHello
puts "Hello!"
end
end
db = Dumber.new()
db.sayHello
## executes sayHello method!
Class Dumber
def sayHi
puts "Hi"
end
end
db.sayHi
## executes the newly added method sayHi!
how does the object already created aware of the newly added method?
class Dumber
def sayHello
puts "Hello!"
end
end
db = Dumber.new()
db.sayHello
## executes sayHello method!
Class Dumber
def sayHi
puts "Hi"
end
end
db.sayHi
## executes the newly added method sayHi!
how does the object already created aware of the newly added method?