2 ms·
> the ruby code: ``` cat = Cat.new cat.meow ``` As a non-Ruby user, this confuses me. Why can't `Cat.new` be a function reference? Does Ruby explicitly
by rirze 3mo ago
> the ruby code:
```
cat = Cat.new
cat.meow
```
As a non-Ruby user, this confuses me. Why can't `Cat.new` be a function reference? Does Ruby explicitly disallow this (i.e. passing around a function)?
- wizzwizz4 3mo agoYou can do this, but there's no syntax. Instead, call the `method` method with `:new` as its argument.