ruby-uebungen/Assignment_016/solution/readme.md

21 lines
225 B
Markdown

# Lösung: Geschachtelte Methoden
```ruby
class Bomb
def self.activate
def explode
puts "Booooommmmm"
end
end
end
b1 = Bomb.new
b2 = Bomb.new
b1.explode # Fehler
Bomb::activate
b1.explode
b2.explode
```