<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta content="text/html; charset=US-ASCII" http-equiv="Content-Type" />

  <title>File: module_ex.rb [liquid-2.6.2 Documentation]</title>

  <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet" />

  <script src="../../js/jquery.js" type="text/javascript"
    charset="utf-8"></script>
  <script src="../../js/thickbox-compressed.js" type="text/javascript"
    charset="utf-8"></script>
  <script src="../../js/quicksearch.js" type="text/javascript"
    charset="utf-8"></script>
  <script src="../../js/darkfish.js" type="text/javascript"
    charset="utf-8"></script>
</head>

<body class="file file-popup">
  <div id="metadata">
    <dl>
      <dt class="modified-date">Last Modified</dt>
      <dd class="modified-date">2015-06-08 23:23:03 +0000</dd>

      
      <dt class="requires">Requires</dt>
      <dd class="requires">
        <ul>
        
        </ul>
      </dd>
      

      
    </dl>
  </div>

  <div id="documentation">
    
    <div class="description">
      <h2>Description</h2>
      
<p>Copyright 2007 by Domizio Demichelis This library is free software. It may
be used, redistributed and/or modified under the same terms as Ruby itself</p>

<p>This extension is used in order to expose the object of the implementing
class to liquid as it were a Drop. It also limits the liquid-callable
methods of the instance to the allowed method passed with the
liquid_methods call Example:</p>

<p>class SomeClass</p>

<pre>liquid_methods :an_allowed_method

def an_allowed_method
  'this comes from an allowed method'
end
def unallowed_method
  'this will never be an output'
end</pre>

<p>end</p>

<p>if you want to extend the drop to other methods you can defines more
methods in the class &lt;YourClass&gt;::LiquidDropClass</p>

<pre>class SomeClass::LiquidDropClass
  def another_allowed_method
    'and this from another allowed method'
  end
end</pre>

<p>end</p>

<p>usage: @something = SomeClass.new</p>

<p>template: {{something.an_allowed_method}}{{something.unallowed_method}}
{{something.another_allowed_method}}</p>

<p>output: 'this comes from an allowed method and this from another allowed
method'</p>

<p>You can also chain associations, by adding the liquid_method call in the
association models.</p>

    </div>
    
  </div>
</body>
</html>

