Sha256: e31dbd73f40d8aa58980bb0d58db6362c67ae9a3a09ba1a0dd7065c23d224675
Contents?: true
Size: 555 Bytes
Versions: 3
Compression:
Stored size: 555 Bytes
Contents
module Xdrgen::AST module Concerns module Contained extend Memoist protected memoize def ancestors current = self.parent result = [] while current.present? result.unshift(current) current = current.parent end result end def root ancestors.first end def namespace find_ancestors(HasDefinitions).last end def find_ancestors(type) ancestors.select{|a| a.is_a?(type)} end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
xdrgen-0.1.1 | lib/xdrgen/ast/concerns/contained.rb |
xdrgen-0.1.0 | lib/xdrgen/ast/concerns/contained.rb |
xdrgen-0.0.1 | lib/xdrgen/ast/concerns/contained.rb |