lib/delorean/base.rb in delorean_lang-2.3.0 vs lib/delorean/base.rb in delorean_lang-2.4.0
- old
+ new
@@ -81,10 +81,16 @@
NodeCall.new(_e, engine, node, params.merge(args))
end
end
class BaseClass
+ def self._safe_navigation_get_attr(obj, attr, _e)
+ return nil if obj.nil?
+
+ _get_attr(obj, attr, _e)
+ end
+
def self._get_attr(obj, attr, _e)
# REALLY FIXME: this really needs to be another "when" in the
# case statement below. However, Gemini appears to create Hash
# objects when running Delorean modules in delayed jobs that
# return true when we called obj.instance_of?(Hash) and do not
@@ -193,9 +199,14 @@
NodeCall.new(_e, engine, node || self, params)
end
######################################################################
+ def self._safe_navigation_instance_call(obj, method, args, _e, &block)
+ return nil if obj.nil?
+
+ _instance_call(obj, method, args, _e, &block)
+ end
def self._instance_call(obj, method, args, _e, &block)
begin
msg = method.to_sym
rescue NoMethodError