lib/psd/nodes/ancestry.rb in psd-0.4.2 vs lib/psd/nodes/ancestry.rb in psd-1.0.0
- old
+ new
@@ -25,11 +25,11 @@
def has_children?
children.length > 0
end
# Inverse of has_children?
- def is_childless?
+ def childless?
!has_children?
end
# Returns all sibling nodes including the current node. Can also
# be thought of as all children of the parent of this node.
@@ -42,10 +42,10 @@
def has_siblings?
siblings.length > 1
end
# Is this node the only descendant of its parent?
- def is_only_child?
+ def only_child?
siblings.length == 1
end
# Recursively get all descendant nodes, not including this node.
def descendants
\ No newline at end of file