ruby-uebungen/Assignment_034/solution
Thomas Smits 58bc23516c Update of exercises 2023-05-25 17:49:42 +02:00
..
readme.md Update of exercises 2023-05-25 17:49:42 +02:00

readme.md

Lösung: Klasse dynamisch erzeugen

def create_class(super_class)
  Class.new(super_class) do
    def who_am_i
     puts "Ich bin ein Kind von #{self.class.superclass}"
    end
  end
end

Test = create_class(Object)
t = Test.new
t.who_am_i