Sha256: 4d19beb152a10c11c32f95dc65f23417e5e8f3746a15eb4657866fdbb9bc13b1

Contents?: true

Size: 992 Bytes

Versions: 38

Compression:

Stored size: 992 Bytes

Contents

require "action_dispatch/http/mime_type"
require 'active_support/core_ext/class/attribute'

# Legacy TemplateHandler stub
module ActionView
  class Template
    module Handlers #:nodoc:
      module Compilable
        def self.included(base)
          base.extend(ClassMethods)
        end

        module ClassMethods
          def call(template)
            new.compile(template)
          end
        end

        def compile(template)
          raise "Need to implement #{self.class.name}#compile(template)"
        end
      end
    end

    class Template::Handler
      class_attribute :default_format
      self.default_format = Mime::HTML

      def self.call(template)
        raise "Need to implement #{self.class.name}#call(template)"
      end

      def render(template, local_assigns)
        raise "Need to implement #{self.class.name}#render(template, local_assigns)"
      end
    end
  end

  TemplateHandlers = Template::Handlers
  TemplateHandler = Template::Handler
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
actionpack-3.0.20 lib/action_view/template/handler.rb
actionpack-3.0.19 lib/action_view/template/handler.rb
actionpack-3.0.18 lib/action_view/template/handler.rb
actionpack-3.0.17 lib/action_view/template/handler.rb
actionpack-3.0.16 lib/action_view/template/handler.rb
actionpack-3.0.15 lib/action_view/template/handler.rb
actionpack-3.0.14 lib/action_view/template/handler.rb
actionpack-3.0.13 lib/action_view/template/handler.rb
actionpack-3.0.13.rc1 lib/action_view/template/handler.rb
actionpack-3.0.12 lib/action_view/template/handler.rb
actionpack-3.0.12.rc1 lib/action_view/template/handler.rb
actionpack-3.0.11 lib/action_view/template/handler.rb
actionpack-3.0.10 lib/action_view/template/handler.rb
actionpack-3.0.10.rc1 lib/action_view/template/handler.rb
actionpack-3.0.9 lib/action_view/template/handler.rb
actionpack-3.0.9.rc5 lib/action_view/template/handler.rb
actionpack-3.0.9.rc4 lib/action_view/template/handler.rb
actionpack-3.0.9.rc3 lib/action_view/template/handler.rb
actionpack-3.0.9.rc1 lib/action_view/template/handler.rb
actionpack-3.0.8 lib/action_view/template/handler.rb