From 33b5de7a2e201eeb01310eaab0c964332fd24416 Mon Sep 17 00:00:00 2001 From: RichMorin Date: Thu, 12 Aug 2010 13:45:59 -0700 Subject: [PATCH] Migrated from using-liquid-without-rails v10 --- Using-Liquid-without-Rails.textile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Using-Liquid-without-Rails.textile b/Using-Liquid-without-Rails.textile index 6274050..0be604a 100644 --- a/Using-Liquid-without-Rails.textile +++ b/Using-Liquid-without-Rails.textile @@ -62,4 +62,17 @@ Run that again and presto:
I'm running to the store with 20 dollars in my pocket to buy a box of sausages.
 
+However, that's a bit verbose, so you may want to use @liquid_methods@, instead: + +
class Product
+  attr_accessor  :name, :price
+  liquid_methods :name, :price
+
+  def initialize(name, price)
+    @name  = name
+    @price = price
+  end
+end
+
+ (Thanks to "Tom's":http://github.com/mojombo "Jekyll":http://github.com/mojombo/jekyll/tree/master/lib/jekyll/post.rb#L122-128 code for helping me figuring this out.) \ No newline at end of file