1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_view/inline_template.rb

27 lines
652 B
Ruby
Raw Normal View History

module ActionView #:nodoc:
class InlineTemplate #:nodoc:
2008-07-05 13:05:50 -04:00
include Renderable
# Count the number of inline templates
cattr_accessor :inline_template_count
@@inline_template_count = 0
def initialize(view, source, locals = {}, type = nil)
@view = view
@source = source
@extension = type
@locals = locals || {}
@method_key = @source
@handler = Template.handler_class_for_extension(@extension).new(@view)
end
private
# FIXME: Modifying this shared variable may not thread safe
def method_name_path_segment
"inline_#{@@inline_template_count += 1}"
end
end
end