lib/databound/data.rb in databound-0.0.3 vs lib/databound/data.rb in databound-0.1.0
- old
+ new
@@ -22,20 +22,20 @@
def interpolated_params
@params.each_with_object({}) do |(key, val), obj|
check_strict!(key, val)
block = dsl_block(key, val)
- obj[key] = block ? block.call(@params.to_options) : val
+ obj[key] = block ? @controller.instance_exec(@params.to_options, &block) : val
end
end
def dsl_block(key, val)
- dsl_key(key).andand[val]
+ swallow_nil { dsl_key(key)[val] }
end
def dsl_key(key)
- @controller.class.dsls.andand[key]
+ swallow_nil { @controller.class.dsls[key] }
end
def check_strict!(key, val)
return unless dsl_key(key)
return unless strict?(key) and !dsl_block(key, val)
@@ -43,9 +43,9 @@
raise NotPermittedError, "DSL column '#{key}' received unmatched string '#{val}'." \
" Use 'strict: false' in DSL definition to allow everything."
end
def strict?(key)
- @controller.class.stricts.andand[key]
+ swallow_nil { @controller.class.stricts[key] }
end
end
end