Module: Utilities::Logic

Defined in:
lib/utilities/logic.rb

Class Method Summary (collapse)

Class Method Details

+ (Array) or_queries(expression)

Parameters:

  • expression (String)

Returns:

  • (Array)


20
21
22
# File 'lib/utilities/logic.rb', line 20

def self.or_queries(expression)
  parse_logic(expression).split('+')
end

+ (String) parse_logic(expression)

Parameters:

  • expression (String)

Returns:

  • (String)


12
13
14
15
16
# File 'lib/utilities/logic.rb', line 12

def self.parse_logic(expression)
  parsed = string2logic(expression)
  simple = parsed.simplify
  simple.sort.to_s
end