Module: JAPR::TemplateHelper

Included in:
CssTagTemplate, JavaScriptTagTemplate
Defined in:
lib/japr/templates/template_helper.rb

Instance Method Summary collapse

Instance Method Details

#output_pathObject



3
4
5
# File 'lib/japr/templates/template_helper.rb', line 3

def output_path
  root_path? ? '' : "/#{@path}"
end

#root_path?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/japr/templates/template_helper.rb', line 7

def root_path?
  stripped_path = @path.to_s.strip
  stripped_path.nil? ||
    stripped_path.empty? ||
    stripped_path == '/'
end