Method: Dry::Struct::ClassInterface#|

Defined in:
lib/dry/struct/class_interface.rb

#|(type) ⇒ Dry::Types::Sum

Build a sum type



377
378
379
380
381
382
383
# File 'lib/dry/struct/class_interface.rb', line 377

def |(type)
  if type.is_a?(::Class) && type <= Struct
    Sum.new(self, type)
  else
    super
  end
end