2023-05-25 17:47:19 +02:00
|
|
|
# Lösung: Singleton Methoden
|
2023-05-23 09:19:31 +02:00
|
|
|
|
2023-05-25 17:49:42 +02:00
|
|
|
|
|
|
|
```ruby
|
2023-05-25 17:47:19 +02:00
|
|
|
s1 = "Hallo"
|
|
|
|
s2 = "Welt"
|
2023-05-23 09:19:31 +02:00
|
|
|
|
2023-05-25 17:47:19 +02:00
|
|
|
def s2.to_leet
|
|
|
|
self.tr('aeiou', '43107')
|
2023-05-23 09:19:31 +02:00
|
|
|
end
|
|
|
|
|
2023-05-25 17:47:19 +02:00
|
|
|
puts s2.to_leet
|
2023-05-23 09:19:31 +02:00
|
|
|
```
|