Module: Pragma::Decorator::Collection::ClassMethods

Defined in:
lib/pragma/decorator/collection.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#decorate_with(decorator) ⇒ Object

TODO:

Accept a callable/block or document how to decorate polymorphic collections

Defines the decorator to use for each resource in the collection.

Parameters:

  • decorator (Class)

    a decorator class



57
58
59
# File 'lib/pragma/decorator/collection.rb', line 57

def decorate_with(decorator)
  collection :represented, as: :data, exec_context: :decorator, decorator: decorator
end