Class: Sexp
- Inherits:
-
Object
- Object
- Sexp
- Defined in:
- lib/flay.rb
Instance Method Summary collapse
- #all_structural_subhashes ⇒ Object
- #deep_each(&block) ⇒ Object
- #each_sexp ⇒ Object
- #structural_hash ⇒ Object
Instance Method Details
#all_structural_subhashes ⇒ Object
299 300 301 302 303 304 305 |
# File 'lib/flay.rb', line 299 def all_structural_subhashes hashes = [] self.deep_each do |node| hashes << node.structural_hash end hashes end |
#deep_each(&block) ⇒ Object
307 308 309 310 311 312 |
# File 'lib/flay.rb', line 307 def deep_each(&block) self.each_sexp do |sexp| block[sexp] sexp.deep_each(&block) end end |
#each_sexp ⇒ Object
314 315 316 317 318 319 320 |
# File 'lib/flay.rb', line 314 def each_sexp self.each do |sexp| next unless Sexp === sexp yield sexp end end |
#structural_hash ⇒ Object
295 296 297 |
# File 'lib/flay.rb', line 295 def structural_hash @structural_hash ||= self.structure.hash end |