Class: ActiveFedora::Aggregation::DecoratorWithArguments

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/aggregation/decorator_with_arguments.rb

Overview

This is an Adapter to allow a Decorator to respond to the interface #new() but still require other arguments to instantiate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(decorator, *args) ⇒ DecoratorWithArguments

Returns a new instance of DecoratorWithArguments.



6
7
8
9
# File 'lib/active_fedora/aggregation/decorator_with_arguments.rb', line 6

def initialize(decorator, *args)
  @decorator = decorator
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



5
6
7
# File 'lib/active_fedora/aggregation/decorator_with_arguments.rb', line 5

def args
  @args
end

#decoratorObject (readonly)

Returns the value of attribute decorator.



5
6
7
# File 'lib/active_fedora/aggregation/decorator_with_arguments.rb', line 5

def decorator
  @decorator
end

Instance Method Details

#new(obj) ⇒ Object



11
12
13
# File 'lib/active_fedora/aggregation/decorator_with_arguments.rb', line 11

def new(obj)
  decorator.new(obj, *args)
end