From 01922a10acf44bb35cecaccc2b9066054c492600 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Sun, 28 Jul 2013 21:18:54 +0200 Subject: [PATCH] Convertible#to_liquid: allow an alternate attribute set to be passed --- lib/jekyll/convertible.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index e2564464..2ac9d0b4 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -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)