Sha256: 1f7b3b525aada81c677a4f8484005dce7b29c9ab658283abd58a3b05b3c6ad89

Contents?: true

Size: 871 Bytes

Versions: 1

Compression:

Stored size: 871 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'remarkably/engines/html'

module Ramaze
  module Template
    class Remarkably < Template
      ENGINES[self] = %w[ rem ]

      class << self

        # Entry point for Action#render

        def transform action
          result, file = result_and_file(action)

          result = transform_string(file, action) if file
          result.to_s
        end

        # Takes a string and action, sets args to action.args and then proceeds
        # to instance_eval the string inside the action.instance

        def transform_string(string, action)
          action.instance.instance_eval do
            args = action.params
            instance_eval(string)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ramaze-0.1.2 lib/ramaze/template/remarkably.rb