Sha256: 4bbc5db31a18e9e0b4c0d099cdda54f0c35d00bbf0c66b7eeeb7eb91422e80c3

Contents?: true

Size: 345 Bytes

Versions: 1

Compression:

Stored size: 345 Bytes

Contents

module Gleborator
  class BaseDecorator
    def initialize(object)
      @object = object
    end

    def self.decorate_collection(collection)
      collection.map {|object| new(object) }
    end

    def self.delegate(*methods)
      options = methods.extract_options!
      super *methods, options.reverse_merge(to: :object)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gleborator-0.1.1.9 lib/gleborator/base_decorator.rb