Class: Stupidedi::Parser::ConstraintTable::Stub

Inherits:
Stupidedi::Parser::ConstraintTable show all
Defined in:
lib/stupidedi/parser/constraint_table.rb

Overview

Performs no filtering of the Instruction list. This is used when there already is a single Instruction or when a Reader::SegmentTok doesn't provide any more information to filter the list.

Instance Attribute Summary

Attributes inherited from Stupidedi::Parser::ConstraintTable

#instructions

Instance Method Summary collapse

Methods inherited from Stupidedi::Parser::ConstraintTable

build, #copy, #critique, #pretty_print

Constructor Details

#initialize(instructions) ⇒ Stub

Returns a new instance of Stub.


58
59
60
# File 'lib/stupidedi/parser/constraint_table.rb', line 58

def initialize(instructions)
  @instructions = instructions
end

Instance Method Details

#matches(segment_tok, strict, mode) ⇒ Array<Instruction>

Returns:


63
64
65
66
67
# File 'lib/stupidedi/parser/constraint_table.rb', line 63

def matches(segment_tok, strict, mode)
  @instructions.tap do |xs|
    critique(segment_tok, xs.map(&:segment_use)) if strict
  end
end