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
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, #find_and_replace_all, #find_node, #find_nodes, from_array, #gsub, include, #line_max, m, #map, #mass, #method_missing, #new, not?, #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
.
1269 1270 1271 |
# File 'lib/sexp.rb', line 1269 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.
1263 1264 1265 |
# File 'lib/sexp.rb', line 1263 def value @value end |
Instance Method Details
#==(o) ⇒ Object
:nodoc:
1284 1285 1286 |
# File 'lib/sexp.rb', line 1284 def == o # :nodoc: super && self.value == o.value end |
#inspect ⇒ Object
:nodoc:
1288 1289 1290 |
# File 'lib/sexp.rb', line 1288 def inspect # :nodoc: "include(%p)" % [value] end |
#pretty_print(q) ⇒ Object
:nodoc:
1292 1293 1294 1295 1296 |
# File 'lib/sexp.rb', line 1292 def pretty_print q # :nodoc: q.group 1, "include(", ")" do q.pp value end end |