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
- #name ⇒ Object
Constructor Details
#initialize(scope) ⇒ TemplatePath
Returns a new instance of TemplatePath.
67 68 69 70 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 67 def initialize(scope) self.full_path = scope.pathname self.template_path = scope.logical_path end |
Instance Method Details
#is_haml? ⇒ Boolean
72 73 74 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 72 def is_haml? full_path.to_s.end_with?('.hamlbars') end |
#is_partial? ⇒ Boolean
76 77 78 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 76 def is_partial? template_path.gsub(%r{.*/}, '').start_with?('_') end |
#name ⇒ Object
80 81 82 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 80 def name is_partial? ? partial_name : template_name end |