Matches anything having the same #sexp_type, which is the first value in a Sexp.
examples:
s(:a, :b) / s{ t(:a) } #=> [s(:a, :b)] s(:a, :b) / s{ t(:b) } #=> [] s(:a, s(:b, :c)) / s{ t(:b) } #=> [s(:b, :c)]
Creates a Matcher which will match any Sexp
who's type is type
, where a type is the first element in
the Sexp.
# File lib/sexp.rb, line 1216 def initialize type @sexp_type = type end
Satisfied if the #sexp_type
of o
is type
.
# File lib/sexp.rb, line 1227 def satisfy? o o.kind_of?(Sexp) && o.sexp_type == sexp_type end