Class: Spider::CompiledTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/spiderfw/templates/template.rb

Overview

Class holding compiled template code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompiledTemplate

Returns a new instance of CompiledTemplate.



954
955
956
957
958
# File 'lib/spiderfw/templates/template.rb', line 954

def initialize()
    @subtemplates = {}
    @subtemplate_owners = {}
    @devel_info = {}
end

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



951
952
953
# File 'lib/spiderfw/templates/template.rb', line 951

def assets
  @assets
end

#blockObject

Returns the value of attribute block.



951
952
953
# File 'lib/spiderfw/templates/template.rb', line 951

def block
  @block
end

#cache_pathObject

Returns the value of attribute cache_path.



951
952
953
# File 'lib/spiderfw/templates/template.rb', line 951

def cache_path
  @cache_path
end

#devel_infoObject

Returns the value of attribute devel_info.



951
952
953
# File 'lib/spiderfw/templates/template.rb', line 951

def devel_info
  @devel_info
end

#source_pathObject

Returns the value of attribute source_path.



951
952
953
# File 'lib/spiderfw/templates/template.rb', line 951

def source_path
  @source_path
end

#subtemplatesObject

Returns the value of attribute subtemplates.



951
952
953
# File 'lib/spiderfw/templates/template.rb', line 951

def subtemplates
  @subtemplates
end

Instance Method Details

#collect_mtimesObject



968
969
970
971
972
# File 'lib/spiderfw/templates/template.rb', line 968

def collect_mtimes
    mtimes = {@source_path => File.mtime(@source_path)}
    @subtemplates.each{ |id, sub| mtimes.merge(sub.collect_mtimes)}
    return mtimes
end

#init_codeObject



960
961
962
# File 'lib/spiderfw/templates/template.rb', line 960

def init_code
    @block.init_code
end

#run_codeObject



964
965
966
# File 'lib/spiderfw/templates/template.rb', line 964

def run_code
    @block.run_code
end