Class: Sexp
- Inherits:
-
Object
- Object
- Sexp
- Defined in:
- lib/flay.rb
Instance Method Summary collapse
- #all_structural_subhashes ⇒ Object
-
#deep_each(&block) ⇒ Object
REFACTOR: move to sexp.rb.
-
#each_sexp ⇒ Object
REFACTOR: move to sexp.rb.
- #structural_hash ⇒ Object
Instance Method Details
#all_structural_subhashes ⇒ Object
302 303 304 305 306 307 308 |
# File 'lib/flay.rb', line 302 def all_structural_subhashes hashes = [] self.deep_each do |node| hashes << node.structural_hash end hashes end |
#deep_each(&block) ⇒ Object
REFACTOR: move to sexp.rb
311 312 313 314 315 316 |
# File 'lib/flay.rb', line 311 def deep_each(&block) self.each_sexp do |sexp| block[sexp] sexp.deep_each(&block) end end |
#each_sexp ⇒ Object
REFACTOR: move to sexp.rb
319 320 321 322 323 324 325 |
# File 'lib/flay.rb', line 319 def each_sexp self.each do |sexp| next unless Sexp === sexp yield sexp end end |
#structural_hash ⇒ Object
298 299 300 |
# File 'lib/flay.rb', line 298 def structural_hash @structural_hash ||= self.structure.hash end |