lib/json_schema/schema.rb in json_schema-0.1.7 vs lib/json_schema/schema.rb in json_schema-0.1.8
- old
+ new
@@ -259,9 +259,17 @@
def original?
!clones.include?(self)
end
+ def depth
+ if parent
+ parent.depth + 1
+ else
+ 0
+ end
+ end
+
def pointer
if parent
parent.pointer + "/" + fragment
else
fragment