Class: Sexp::MatchCollection
Overview
Instance Method Summary collapse
-
#/(pattern) ⇒ Object
See Traverse#search.
-
#inspect ⇒ Object
(also: #to_s)
:nodoc:.
-
#pretty_print(q) ⇒ Object
:nodoc:.
Instance Method Details
#/(pattern) ⇒ Object
See Traverse#search
1394 1395 1396 1397 1398 |
# File 'lib/sexp.rb', line 1394 def / pattern inject(self.class.new) { |result, match| result.concat match / pattern } end |
#inspect ⇒ Object Also known as: to_s
:nodoc:
1400 1401 1402 |
# File 'lib/sexp.rb', line 1400 def inspect # :nodoc: "MatchCollection.new(%s)" % self.to_a.inspect[1..-2] end |
#pretty_print(q) ⇒ Object
:nodoc:
1406 1407 1408 1409 1410 |
# File 'lib/sexp.rb', line 1406 def pretty_print q # :nodoc: q.group 1, "MatchCollection.new(", ")" do q.seplist(self) {|v| q.pp v } end end |