Module: Pragma::Operation::Decoration::ClassMethods
- Defined in:
- lib/pragma/operation/decoration.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#decorator(klass = nil) { ... } ⇒ Object
Sets the decorator to use for decorating this operation.
-
#decorator_klass ⇒ Class
Returns the decorator class.
Instance Method Details
#decorator(klass = nil) { ... } ⇒ Object
Sets the decorator to use for decorating this operation.
20 21 22 23 24 25 26 |
# File 'lib/pragma/operation/decoration.rb', line 20 def decorator(klass = nil, &block) if !klass && !block_given? fail ArgumentError, 'You must pass either a decorator class or a block' end @decorator = klass || block end |
#decorator_klass ⇒ Class
Returns the decorator class.
31 32 33 |
# File 'lib/pragma/operation/decoration.rb', line 31 def decorator_klass @decorator end |