kchien/haberdasher

View on GitHub
lib/haberdasher/decoratoratable.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'active_support'

module Haberdasher
  module Decoratoratable
    def decorate
      decorator_class.new self
    end

    def decorator_class
      "#{self.class}Decorator".constantize
    end
  end
end