Class: Low::TypeFactory

Inherits:
Object show all
Defined in:
lib/factories/type_factory.rb

Class Method Summary collapse

Class Method Details

.complex_type(parent_type) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/factories/type_factory.rb', line 6

def complex_type(parent_type)
  Class.new(parent_type) do
    def self.match?(value:)
      return true if value.instance_of?(self.class) || value.instance_of?(superclass)

      false
    end
  end
end