lib/guerrilla_patch/kernel.rb in guerrilla_patch-2.1.0 vs lib/guerrilla_patch/kernel.rb in guerrilla_patch-2.2.0
- old
+ new
@@ -32,8 +32,13 @@
alias :always :add
def when_present(item, &block)
@result << Kernel.when_present(item, &block).to_s
end
+
+ def when(item, &block)
+ return unless item
+ @result << Kernel.when_present(item, &block).to_s
+ end
end
end