天天看点

Rails源代码分析(44):ActionView Template (2)

InlineTemplate主要区别在于初始化方法以及source的定义

 module ActionView #:nodoc:

class InlineTemplate < Template #:nodoc:

def initialize(view, source, locals = {}, type = nil)

@view = view

@finder = @view.finder

@source = source

@extension = type

@locals = locals || {}

@handler = self.class.handler_class_for_extension(@extension).new(@view)

end

def method_key

@source

end

end

end

继续阅读