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.



1000
1001
1002
1003
1004
# File 'lib/spiderfw/templates/template.rb', line 1000

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

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



997
998
999
# File 'lib/spiderfw/templates/template.rb', line 997

def assets
  @assets
end

#blockObject

Returns the value of attribute block.



997
998
999
# File 'lib/spiderfw/templates/template.rb', line 997

def block
  @block
end

#cache_pathObject

Returns the value of attribute cache_path.



997
998
999
# File 'lib/spiderfw/templates/template.rb', line 997

def cache_path
  @cache_path
end

#devel_infoObject

Returns the value of attribute devel_info.



997
998
999
# File 'lib/spiderfw/templates/template.rb', line 997

def devel_info
  @devel_info
end

#source_pathObject

Returns the value of attribute source_path.



997
998
999
# File 'lib/spiderfw/templates/template.rb', line 997

def source_path
  @source_path
end

#subtemplatesObject

Returns the value of attribute subtemplates.



997
998
999
# File 'lib/spiderfw/templates/template.rb', line 997

def subtemplates
  @subtemplates
end

Instance Method Details

#collect_mtimesObject



1014
1015
1016
1017
1018
# File 'lib/spiderfw/templates/template.rb', line 1014

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

#init_codeObject



1006
1007
1008
# File 'lib/spiderfw/templates/template.rb', line 1006

def init_code
    @block.init_code
end

#run_codeObject



1010
1011
1012
# File 'lib/spiderfw/templates/template.rb', line 1010

def run_code
    @block.run_code
end