Class: ActiveEntity::Type::DecorationRegistration

Inherits:
Registration
  • Object
show all
Defined in:
lib/active_entity/type/registry.rb

Overview

:nodoc:

Instance Method Summary collapse

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(options, klass, **)
  @options = 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(*options.keys))
  klass.new(subtype)
end

#matches?(*args, **kwargs) ⇒ Boolean

Returns:



91
92
93
# File 'lib/active_entity/type/registry.rb', line 91

def matches?(*args, **kwargs)
  matches_options?(**kwargs)
end

#priorityObject



95
96
97
# File 'lib/active_entity/type/registry.rb', line 95

def priority
  super | 4
end