Class: HandlebarsAssets::TiltHandlebars::TemplatePath

Inherits:
Object
  • Object
show all
Defined in:
lib/handlebars_assets/tilt_handlebars.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


42
43
44
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 42

def is_partial?
  template_path.gsub(%r{.*/}, '').start_with?('_')
end

#nameObject



46
47
48
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 46

def name
  is_partial? ? partial_name : template_name
end