Class: Sexp

Inherits:
Object
  • Object
show all
Defined in:
lib/flay.rb

Instance Method Summary collapse

Instance Method Details

#all_structural_subhashesObject



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_sexpObject

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_hashObject



298
299
300
# File 'lib/flay.rb', line 298

def structural_hash
  @structural_hash ||= self.structure.hash
end