Class: HandlebarsAssets::TiltHandlebars::TemplatePath
- Inherits:
-
Object
- Object
- HandlebarsAssets::TiltHandlebars::TemplatePath
- Defined in:
- lib/handlebars_assets/tilt_handlebars.rb
Instance Method Summary collapse
-
#initialize(scope) ⇒ TemplatePath
constructor
A new instance of TemplatePath.
- #is_haml? ⇒ Boolean
- #is_partial? ⇒ Boolean
- #is_slim? ⇒ Boolean
- #name ⇒ Object
Constructor Details
#initialize(scope) ⇒ TemplatePath
Returns a new instance of TemplatePath.
76 77 78 79 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 76 def initialize(scope) self.full_path = scope.pathname self.template_path = scope.logical_path end |
Instance Method Details
#is_haml? ⇒ Boolean
81 82 83 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 81 def is_haml? full_path.to_s.end_with?('.hamlbars') end |
#is_partial? ⇒ Boolean
89 90 91 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 89 def is_partial? template_path.gsub(%r{.*/}, '').start_with?('_') end |
#is_slim? ⇒ Boolean
85 86 87 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 85 def is_slim? full_path.to_s.end_with?('.slimbars') end |
#name ⇒ Object
93 94 95 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 93 def name template_name end |