Class: HoganAssets::Tilt::TemplatePath
- Inherits:
-
Object
- Object
- HoganAssets::Tilt::TemplatePath
- Defined in:
- lib/hogan_assets/tilt.rb
Instance Attribute Summary collapse
-
#full_path ⇒ Object
Returns the value of attribute full_path.
Instance Method Summary collapse
-
#initialize(scope) ⇒ TemplatePath
constructor
A new instance of TemplatePath.
- #is_hamstache? ⇒ Boolean
- #is_slimstache? ⇒ Boolean
- #name ⇒ Object
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_path ⇒ Object
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
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
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 |
#name ⇒ Object
71 72 73 |
# File 'lib/hogan_assets/tilt.rb', line 71 def name @name ||= relative_path.dump end |