Sha256: c8294109035d86f986ec831c5ac8a56e5c28961104a3b8663267f1470094e308

Contents?: true

Size: 387 Bytes

Versions: 10

Compression:

Stored size: 387 Bytes

Contents

module ActiveFedora::Aggregation
  # A composite object to allow for a list of decorators to be treated like one.
  class DecoratorList
    attr_reader :decorators
    def initialize(*decorators)
      @decorators = decorators
    end

    def new(undecorated_object)
      decorators.inject(undecorated_object) do |obj, decorator|
        decorator.new(obj)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
activefedora-aggregation-0.9.0 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.8.1 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.8.0 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.7.0 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.6.0 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.5.0 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.4.2 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.4.1 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.4.0 lib/active_fedora/aggregation/decorator_list.rb
activefedora-aggregation-0.3.0 lib/active_fedora/aggregation/decorator_list.rb