ruby-uebungen/Assignment_017/solution/readme.md

20 lines
467 B
Markdown
Raw Normal View History

2023-05-23 09:19:31 +02:00
# Lösung: Geschachtelte Methoden
<div style="border: 1px solid grey;"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div>```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
```