Class: HoganAssets::Tilt::TemplatePath

Inherits:
Object
  • Object
show all
Defined in:
lib/hogan_assets/tilt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope) ⇒ TemplatePath

Returns a new instance of TemplatePath.



56
57
58
59
# File 'lib/hogan_assets/tilt.rb', line 56

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.



54
55
56
# File 'lib/hogan_assets/tilt.rb', line 54

def full_path
  @full_path
end

Instance Method Details

#is_hamstache?Boolean

Returns:

  • (Boolean)


61
62
63
64
# File 'lib/hogan_assets/tilt.rb', line 61

def is_hamstache?
  file_path = full_path.to_s
  HoganAssets::Config.hamstache_extensions.any? { |ext| file_path.to_s.end_with? ext }
end

#is_slimstache?Boolean

Returns:

  • (Boolean)


66
67
68
69
# File 'lib/hogan_assets/tilt.rb', line 66

def is_slimstache?
  file_path = full_path.to_s
  HoganAssets::Config.slimstache_extensions.any? { |ext| file_path.to_s.end_with? ext }
end

#nameObject



71
72
73
# File 'lib/hogan_assets/tilt.rb', line 71

def name
  @name ||= relative_path.dump
end