Class: RIO::Match::Record::Proc

Inherits:
Base show all
Defined in:
lib/rio/matchrecord.rb

Instance Method Summary collapse

Methods inherited from Base

#inspect, #match_all?, #match_none?, #val

Constructor Details

#initialize(arg, therio) ⇒ Proc

Returns a new instance of Proc.



80
81
82
83
# File 'lib/rio/matchrecord.rb', line 80

def initialize(arg,therio)
  super(arg)
  @therio = therio
end

Instance Method Details

#match?(val, recno) ⇒ Boolean

Returns:

  • (Boolean)


84
85
86
87
88
# File 'lib/rio/matchrecord.rb', line 84

def match?(val,recno)
  #p "match?(#{val},#{recno}) select_arg=#{@select_arg}"
  args = [val,recno,@therio]
  @select_arg.call(*args[0,@select_arg.arity])
end