Class: SexpPath::Matcher::Block
- Defined in:
- lib/sexp_path/matcher/block.rb
Instance Attribute Summary collapse
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Block
constructor
A new instance of Block.
- #inspect ⇒ Object
- #satisfy?(o, data = {}) ⇒ Boolean
Methods inherited from Base
Methods included from Traverse
#capture_as, #replace_sexp, #search, #search_each
Constructor Details
#initialize(&block) ⇒ Block
Returns a new instance of Block.
3 4 5 |
# File 'lib/sexp_path/matcher/block.rb', line 3 def initialize &block @exp = block end |
Instance Attribute Details
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
2 3 4 |
# File 'lib/sexp_path/matcher/block.rb', line 2 def exp @exp end |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/sexp_path/matcher/block.rb', line 13 def inspect "<custom>" end |
#satisfy?(o, data = {}) ⇒ Boolean
7 8 9 10 11 |
# File 'lib/sexp_path/matcher/block.rb', line 7 def satisfy?(o, data={}) return nil unless @exp[o] capture_match o, data end |