Module: Mihari::Schemas::Concerns::Orrable

Extended by:
ActiveSupport::Concern
Included in:
Analyzers, Emitters, Enrichers
Defined in:
lib/mihari/schemas/concerns/orrable.rb

Overview

OR-rable concern

Instance Method Summary collapse

Instance Method Details

#compose_by_orObject



12
13
14
15
16
17
18
19
20
# File 'lib/mihari/schemas/concerns/orrable.rb', line 12

def compose_by_or
  schemas = constants.map { |sym| const_get sym }
  return schemas.first if schemas.length <= 1

  base, *others = schemas
  others.each { |other| base = base.or(other) }

  base
end