Sha256: f78b4ec301366b75abae57d0aa6abeea3c756bee326a489606e27d08bfd7d7f8

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

module Gleborator
  module Setup
    extend ActiveSupport::Concern

    def decorate
      begin
        decorator_class = "#{self.class.name}Decorator".constantize
        decorator_class.new(self)
      rescue NameError => e
        raise "Couldn't find decorator #{self.class.name}Decorator"
      end
    end

    module ClassMethods
      def decorate
        # begin
          raise self.inspect
          decorator_class = "#{self.name}Decorator".constantize
          decorator_class.decorate_collection(self)
        # rescue NameError => e
          # raise "Couldn't find decorator #{self.name}Decorator"
        # end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gleborator-0.1.1.7 lib/gleborator/setup.rb