Injet method into an Ruby object in run time


class Person
end

person = Person.new

def person.talk
  puts "Hi"
end

person.talk

Leave a Reply

Your email address will not be published.