lib/active_scaffold/configurable.rb in active_scaffold-3.6.0.pre vs lib/active_scaffold/configurable.rb in active_scaffold-3.6.0.rc1
- old
+ new
@@ -1,7 +1,9 @@
module ActiveScaffold
- # Exposes a +configure+ method that accepts a block and runs all contents of the block in two contexts, as opposed to the normal one. First, everything gets evaluated as part of the object including Configurable. Then, as a failover, missing methods and variables are evaluated in the original binding of the block.
+ # Exposes a +configure+ method that accepts a block and runs all contents of the block in two contexts,
+ # as opposed to the normal one. First, everything gets evaluated as part of the object including Configurable.
+ # Then, as a failover, missing methods and variables are evaluated in the original binding of the block.
#
# Note that this only works with "barewords". Constants, instance variables, and class variables are not currently supported in both contexts.
#
# May add the given functionality at both the class and instance level. For the former, use +extend+, and for the latter, use +include+.
module Configurable
@@ -20,11 +22,11 @@
super
end
end
def respond_to_missing?(name, include_all = false)
- if @configuration_binding
- @configuration_binding.respond_to?(name, include_all)
+ if defined? @configuration_binding
+ @configuration_binding&.respond_to?(name, include_all)
else
super
end
end
end