Class: ActiveEntity::Type::DecorationRegistration
- Inherits:
-
Registration
- Object
- Registration
- ActiveEntity::Type::DecorationRegistration
- Defined in:
- lib/active_entity/type/registry.rb
Overview
:nodoc:
Instance Method Summary collapse
- #call(registry, *args, **kwargs) ⇒ Object
-
#initialize(options, klass) ⇒ DecorationRegistration
constructor
A new instance of DecorationRegistration.
- #matches?(*args, **kwargs) ⇒ Boolean
- #priority ⇒ Object
Methods inherited from Registration
Constructor Details
#initialize(options, klass) ⇒ DecorationRegistration
Returns a new instance of DecorationRegistration.
81 82 83 84 |
# File 'lib/active_entity/type/registry.rb', line 81 def initialize(, klass, **) @options = @klass = klass end |
Instance Method Details
#call(registry, *args, **kwargs) ⇒ Object
86 87 88 89 |
# File 'lib/active_entity/type/registry.rb', line 86 def call(registry, *args, **kwargs) subtype = registry.lookup(*args, **kwargs.except(*.keys)) klass.new(subtype) end |
#matches?(*args, **kwargs) ⇒ Boolean
91 92 93 |
# File 'lib/active_entity/type/registry.rb', line 91 def matches?(*args, **kwargs) (**kwargs) end |
#priority ⇒ Object
95 96 97 |
# File 'lib/active_entity/type/registry.rb', line 95 def priority super | 4 end |