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_partial? ⇒ Boolean
- #name ⇒ Object
Constructor Details
#initialize(scope) ⇒ TemplatePath
Returns a new instance of TemplatePath.
38 39 40 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 38 def initialize(scope) self.template_path = scope.logical_path end |
Instance Method Details
#is_partial? ⇒ Boolean
42 43 44 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 42 def is_partial? template_path.gsub(%r{.*/}, '').start_with?('_') end |
#name ⇒ Object
46 47 48 |
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 46 def name is_partial? ? partial_name : template_name end |