Class: Sexp::Include
Overview
Constant Summary
Constants inherited from Sexp
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
The value that should be included in the match.
Attributes inherited from Sexp
#comments, #file, #line, #line_max
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
o
is a Sexp and one ofo
‘s elements matches value.
Methods inherited from Matcher
#&, #-@, #/, #=~, #>>, #greedy?, match_subs=, match_subs?, parse, #|
Methods inherited from Sexp
#/, #=~, _, ___, all, any, #array_type?, atom, child, #compact, #deep_each, #depth, #each_of_type, #each_sexp, #eql?, #find_and_replace_all, #find_node, #find_nodes, from_array, #gsub, #hash, include, k, m, #map, #mass, #method_missing, #new, not?, q, #replace_sexp, #respond_to?, s, #search_each, #sexp_body, #sexp_body=, #sexp_type, #sexp_type=, #shift, #structure, #sub, t, #to_a
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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Sexp
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 |