RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Use Ruby’s Refinements Anywhere With An Anonymous Class

After lots of experimentation and searching over a few years I’ve finally found a way to use Ruby’s refinements conveniently and anywhere. You don’t need to define a class method to use the refinement or instantiate an instance of a class that has the using syntax in it. You may use using in an anonymous class if it is opened with the shovel operator « . Read more here: Use Ruby’s Refinements Anywhere With An Anonymous Class

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in