Sha256: 523234717564a0eef578da3c293efdbb005fdf7ddcf1ae86340f1c63306c0175

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

module View

  (@@proc_table ||= {})['image_page'] = proc do
_buf = ""; _buf << "<html>
  <head>
  </head>
  <body>

    <h1>Variable in image page</h1>
    <table>
      <tr>
        <td>
          image.name
        </td>
        <td>
          <%= image.name %>
        </td>
      </tr>

      <tr>
        <td>
          image.description
        </td>
        <td>
          <%= image.description %>
        </td>
      </tr>

      <tr>
        <td>
          <pre>image.relroot</pre>
        </td>
        <td>
          <%= image.relroot %>
        </td>
      </tr>

    </table>
  </body>
</html>"; ; _buf
  end#proc

  module_function
  def expand_image_page(context={})
    if context.is_a?(Hash)
      hash = context
      context = Object.new
      hash.each { |key, val| context.instance_variable_set("@#{key}", val) }
    end
    proc_obj = @@proc_table['image_page']
    context.instance_eval(&proc_obj)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gf-ralbum-0.0.2 lib/ralbum/skins/test_erb/out/image_page.rb
gf-ralbum-0.0.5 lib/ralbum/skins/test_erb/out/image_page.rb