Class: LiquidAssets::PipelineTemplateEngine::TemplatePath

Inherits:
Object
  • Object
show all
Defined in:
lib/liquid_assets/pipeline_template_engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope) ⇒ TemplatePath

Returns a new instance of TemplatePath.



30
31
32
33
# File 'lib/liquid_assets/pipeline_template_engine.rb', line 30

def initialize(scope)
    self.template_path = scope.logical_path
    self.full_path = scope.pathname
end

Instance Attribute Details

#full_pathObject

Returns the value of attribute full_path.



28
29
30
# File 'lib/liquid_assets/pipeline_template_engine.rb', line 28

def full_path
  @full_path
end

#template_pathObject

Returns the value of attribute template_path.



40
41
42
# File 'lib/liquid_assets/pipeline_template_engine.rb', line 40

def template_path
  @template_path
end

Instance Method Details

#nameObject



35
36
37
# File 'lib/liquid_assets/pipeline_template_engine.rb', line 35

def name
    @name ||= relative_path
end

#relative_pathObject



42
43
44
# File 'lib/liquid_assets/pipeline_template_engine.rb', line 42

def relative_path
    @relative_path ||= template_path.sub(/^#{LiquidAssets::Config.path_prefix}\/(.*)$/i, '\1' )
end