diff --git a/lib/apex/frame/immutable_path.rb b/lib/apex/frame/immutable_path.rb index bfd90c3fe46b48004251753279604d3259d97c50..b04cf390c80070149f5ca86b4f2ef410b161776d 100644 --- a/lib/apex/frame/immutable_path.rb +++ b/lib/apex/frame/immutable_path.rb @@ -68,6 +68,11 @@ module Apex return @path_array.length end + public + def empty? + return @path_array.empty? + end + public def eql?(other) raise ArgumentError.new("The argument must be of type Path (or a child class).") if not other.kind_of? Path diff --git a/lib/apex/frame/path.rb b/lib/apex/frame/path.rb index 0bbdfe39b67d8b272db41ec7d4754bd34c3fd568..75af1dc802ddf783acd62e841220171c40ee696e 100644 --- a/lib/apex/frame/path.rb +++ b/lib/apex/frame/path.rb @@ -3,6 +3,6 @@ module Apex module Path include Abstractify::Abstract - abstract :each, :[], :length, :eql?, :==, :to_s, :to_string_array, :to_array + abstract :each, :[], :length, :eql?, :==, :to_s, :to_string_array, :to_array, :empty? end end