Class: Sexp::Include
Overview
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
The value that should be included in the match.
Instance Method Summary collapse
-
#==(o) ⇒ Object
:nodoc:.
-
#initialize(value) ⇒ Include
constructor
Creates a Matcher which will match any Sexp that contains the
value. -
#inspect ⇒ Object
:nodoc:.
-
#pretty_print(q) ⇒ Object
:nodoc:.
-
#satisfy?(o) ⇒ Boolean
Satisfied if a
ois a Sexp and one of +o+'s elements matches value.
Methods inherited from Matcher
#&, #-@, #/, #=~, #>>, #greedy?, match_subs=, match_subs?, parse, #|
Constructor Details
#initialize(value) ⇒ Include
Creates a Matcher which will match any Sexp that contains the
value.
948 949 950 |
# File 'lib/sexp_matcher.rb', line 948 def initialize value @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
The value that should be included in the match.
942 943 944 |
# File 'lib/sexp_matcher.rb', line 942 def value @value end |
Instance Method Details
#==(o) ⇒ Object
:nodoc:
963 964 965 |
# File 'lib/sexp_matcher.rb', line 963 def == o # :nodoc: super && self.value == o.value end |
#inspect ⇒ Object
:nodoc:
967 968 969 |
# File 'lib/sexp_matcher.rb', line 967 def inspect # :nodoc: "include(%p)" % [value] end |
#pretty_print(q) ⇒ Object
:nodoc:
971 972 973 974 975 |
# File 'lib/sexp_matcher.rb', line 971 def pretty_print q # :nodoc: q.group 1, "include(", ")" do q.pp value end end |