Method: Path#inside?

Defined in:
lib/path.rb

#inside?(ancestor) ⇒ Boolean

Whether self is inside ancestor, such that ancestor is an ancestor of self. This is pure String manipulation. Paths should be absolute. self is considered to be inside itself.

Returns:

  • (Boolean)


94
95
96
# File 'lib/path.rb', line 94

def inside? ancestor
  @path == ancestor.to_s or @path.start_with?("#{ancestor}/")
end