Module: Sexpr::Node
- Included in:
- Sexpr
- Defined in:
- lib/sexpr/node.rb
Constant Summary collapse
- EMPTY_TRACKING_MARKERS =
{}
Instance Method Summary collapse
- #sexpr_body ⇒ Object (also: #sexp_body)
- #sexpr_copy(&block) ⇒ Object (also: #dup)
- #sexpr_type ⇒ Object (also: #sexp_type)
- #tracking_markers ⇒ Object
- #tracking_markers=(markers) ⇒ Object
Instance Method Details
#sexpr_body ⇒ Object Also known as: sexp_body
19 20 21 |
# File 'lib/sexpr/node.rb', line 19 def sexpr_body self[1..-1] end |
#sexpr_copy(&block) ⇒ Object Also known as: dup
24 25 26 27 28 29 30 31 |
# File 'lib/sexpr/node.rb', line 24 def sexpr_copy(&block) if block copy = sexpr_copy_tagging([ sexpr_type ]) sexpr_body.inject(copy, &block) else sexpr_copy_tagging(self[0..-1]) end end |
#sexpr_type ⇒ Object Also known as: sexp_type
14 15 16 |
# File 'lib/sexpr/node.rb', line 14 def sexpr_type first end |
#tracking_markers ⇒ Object
6 7 8 |
# File 'lib/sexpr/node.rb', line 6 def tracking_markers @tracking_markers ||= EMPTY_TRACKING_MARKERS end |
#tracking_markers=(markers) ⇒ Object
10 11 12 |
# File 'lib/sexpr/node.rb', line 10 def tracking_markers=(markers) @tracking_markers = markers end |