class EditInPlace::ArrayDefinition

{ArrayDefinition} is a subclass of Middlegem::ArrayDefinition that works properly with {MiddlewareWrapper} instances. The problem is that Middlegem::ArrayDefinition, by default, tries to use the class of the defined middlewares themselves. By overriding {matches_class?}, {ArrayDefinition} is able to cause middlegem to use the class of the base middleware of any {MiddlewareWrapper} instances.

@author Jacob Lockard @since 0.2.0

Protected Instance Methods

matches_class?(middleware, klass) click to toggle source

Overrides matches_class? to use the base middleware's class if the middleware is a {MiddlewareWrapper}. @param middleware [Object] the middleware to check. @param klass [Class] the class against which the middleware should be checked. @return [Boolean] whether the given middleware has the given class.

Calls superclass method
# File lib/edit_in_place/array_definition.rb, line 22
def matches_class?(middleware, klass)
  middleware.is_a?(MiddlewareWrapper) ? middleware.base.instance_of?(klass) : super
end