Convertible#to_liquid: allow an alternate attribute set to be passed

This commit is contained in:
maul.esel 2013-07-28 21:18:54 +02:00
parent 6c6dd173c7
commit 01922a10ac
1 changed files with 2 additions and 2 deletions

View File

@ -87,8 +87,8 @@ module Jekyll
# Convert this Convertible's data to a Hash suitable for use by Liquid.
#
# Returns the Hash representation of this Convertible.
def to_liquid
further_data = Hash[self.class::ATTRIBUTES_FOR_LIQUID.map { |attribute|
def to_liquid(attrs = nil)
further_data = Hash[(attrs || self.class::ATTRIBUTES_FOR_LIQUID).map { |attribute|
[attribute, send(attribute)]
}]
data.deep_merge(further_data)