Class: Ibex::Runtime::RepairSearchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/json5/generated_parser.rb

Overview

Closed internal outcome for callers that must distinguish bounded search exhaustion from a complete search with no repair.

Constant Summary collapse

STATUSES =

Signature:

  • Array[Symbol]

%i[selected need_input exhausted not_found].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, plan:, configurations:) ⇒ RepairSearchResult

Returns a new instance of RepairSearchResult.

RBS:

  • (status: Symbol, plan: RepairPlan?, configurations: Integer) -> void

Raises:

  • (ArgumentError)


4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
# File 'lib/json5/generated_parser.rb', line 4572

def initialize(status:, plan:, configurations:)
  raise ArgumentError, "unknown repair search status #{status.inspect}" unless STATUSES.include?(status)
  unless configurations.is_a?(Integer) && configurations >= 0
    raise ArgumentError, "repair search configurations must be nonnegative"
  end
  unless (status == :selected) == plan.is_a?(RepairPlan)
    raise ArgumentError, "selected repair search status and plan must agree"
  end

  @status = status
  @plan = plan
  @configurations = configurations
  freeze
end

Instance Attribute Details

#configurationsObject (readonly)

Signature:

  • Integer



4569
4570
4571
# File 'lib/json5/generated_parser.rb', line 4569

def configurations
  @configurations
end

#planObject (readonly)

Signature:

  • RepairPlan?



4568
4569
4570
# File 'lib/json5/generated_parser.rb', line 4568

def plan
  @plan
end

#statusObject (readonly)

Signature:

  • Symbol



4567
4568
4569
# File 'lib/json5/generated_parser.rb', line 4567

def status
  @status
end

Instance Method Details

#selected?Boolean

RBS:

  • () -> bool

Returns:

  • (Boolean)


4588
# File 'lib/json5/generated_parser.rb', line 4588

def selected? = @status == :selected