matthewrudy / memoist

ActiveSupport::Memoizable with a few enhancements
MIT License
920 stars 99 forks source link

add DSL #48

Closed ASnow closed 8 years ago

ASnow commented 8 years ago

It will be cool to implement DSL for duplications reduce.

class Example
  extend Memoist

  mem :method_name do |args|
  end
end
mehanoid commented 8 years ago

It is not necessary with ruby 2.1, it can be written as:

class Example
  extend Memoist

  memoize def method_name(args)
  end
end
matthewrudy commented 8 years ago

@mehanoid that's what I do, yeah.