Class: ActiveFedora::Aggregation::DecoratorWithArguments
- Inherits:
-
Object
- Object
- ActiveFedora::Aggregation::DecoratorWithArguments
- 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
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#decorator ⇒ Object
readonly
Returns the value of attribute decorator.
Instance Method Summary collapse
-
#initialize(decorator, *args) ⇒ DecoratorWithArguments
constructor
A new instance of DecoratorWithArguments.
- #new(obj) ⇒ Object
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
#args ⇒ Object (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 |
#decorator ⇒ Object (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 |