Drop: hash syntax should use setter method for a property if it's defined
This commit is contained in:
parent
87978e79f4
commit
06c45df8c3
|
@ -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."
|
||||
|
|
Loading…
Reference in New Issue