From 06c45df8c3181fa2967dcc7952939e90b11af23a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 4 Jan 2016 12:09:19 -0800 Subject: [PATCH] Drop: hash syntax should use setter method for a property if it's defined --- lib/jekyll/drops/drop.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/drops/drop.rb b/lib/jekyll/drops/drop.rb index c194a5ba..af249996 100644 --- a/lib/jekyll/drops/drop.rb +++ b/lib/jekyll/drops/drop.rb @@ -62,7 +62,9 @@ module Jekyll # and the key matches a method in which case it raises a # DropMutationException. def []=(key, val) - if self.class.mutable + if respond_to?("#{key}=") + public_send("#{key}=", val) + elsif self.class.mutable @mutations[key] = val elsif respond_to? key raise Errors::DropMutationException, "Key #{key} cannot be set in the drop."