Sha256: 0200fe1a0ce22c1537c5bca3175a1e331aca0997bc408d2cff47f6273162f97d
Contents?: true
Size: 599 Bytes
Versions: 6
Compression:
Stored size: 599 Bytes
Contents
require_relative 'unary_input_expression' module Zenlish module Inflect class MatchesPattern < UnaryInputExpression attr_reader :pattern def initialize(anArgument, aPattern) super(anArgument) @pattern = aPattern end def success?(headings, lexeme, actuals) val = nil if actuals.empty? # require 'debug' hd = headings[argument.index] val = hd.evaluate_for(lexeme) else val = actuals[argument.index] end val =~ pattern end end # class end # module end # module
Version data entries
6 entries across 6 versions & 1 rubygems