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.



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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


85
86
87
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 85

def is_slim?
  full_path.to_s.end_with?('.slimbars')
end

#nameObject



93
94
95
# File 'lib/handlebars_assets/tilt_handlebars.rb', line 93

def name
  template_name
end