Sha256: 7dfb13bf2945db11b93f1e250e823d3a3290192c8adadf6adf6e45fed732c54b

Contents?: true

Size: 995 Bytes

Versions: 2

Compression:

Stored size: 995 Bytes

Contents

module View

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

      <h1>Variables in album page</h1>
      <tr>
        <td>
          <pre>album.name</pre>
        </td>
        <td>
          <%= album.name %>
        </td>
      </tr>

      <tr>
        <td>
          <pre>album.description</pre>
        </td>
        <td>
          <%= album.description %>
        </td>
      </tr>

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

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

  module_function
  def expand_album_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['album_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/album_page.rb
gf-ralbum-0.0.5 lib/ralbum/skins/test_erb/out/album_page.rb