Hacker News new | ask | show | jobs
by rirze 22 days 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)?

1 comments

You can do this, but there's no syntax. Instead, call the `method` method with `:new` as its argument.