Class: Mutant::Expression::Parser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/expression/parser.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(input) ⇒ Either<String, Expression>?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parse expression

Parameters:

  • input (String)

Returns:



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/mutant/expression/parser.rb', line 17

def call(input)
  expressions = expressions(input)
  case expressions.length
  when 0
    Either::Left.new("Expression: #{input.inspect} is invalid")
  when 1
    Either::Right.new(expressions.first)
  else
    Either::Left.new("Expression: #{input.inspect} is ambiguous")
  end
end