Added Ruby::Node#if_false

This commit is contained in:
Yorick Peterse committed 2015-08-19 20:14:24 +02:00
1 parent 4b50a161ed
commit 0dcee637d3
2 files changed
+24

No files matched your search

+9
View File
@@ -148,6 +148,15 @@ module Oga
Node.new(:if, [self, yield])
end
##
# Wraps the current node in an `if !...` statement.
#
# @see [#if_true]
#
def if_false
self.not.if_true { yield }
end
##
# Wraps the current node in a `while` statement.
#