Skip to content

Instantly share code, notes, and snippets.

@dux
dux / decorator_clone.rb
Last active October 20, 2023 13:51
Simple ruby decorators with example
class DecoratorClone
def initialize(model)
@model = model
end
def method_missing(m, *args)
raise NameError, "Decorator method '#{m}' not found" unless @model.respond_to?(m)
@model.send(m, *args)
end
end