lib/abstractivator/proc_ext.rb in abstractivator-0.16.0 vs lib/abstractivator/proc_ext.rb in abstractivator-0.17.0
- old
+ new
@@ -159,9 +159,17 @@
raise 'size must be exactly one' unless size == 1
proc{|x| x[first]}
end
end
+class Symbol
+ def to_safe_proc
+ proc do |x|
+ x&.send(self)
+ end
+ end
+end
+
class Object
def callable?
respond_to?(:call)
end