Class: ActionviewPrecompiler::TemplateFile

Inherits:
Object
  • Object
show all
Defined in:
lib/actionview_precompiler/template_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fullpath, relative_path) ⇒ TemplateFile

Returns a new instance of TemplateFile.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/actionview_precompiler/template_file.rb', line 6

def initialize(fullpath, relative_path)
  @fullpath = fullpath
  @relative_path = relative_path
  @virtual_path = relative_path.slice(0, relative_path.index("."))

  parsed = ParsedFilename.new(relative_path)
  @prefix = parsed.prefix
  @action = parsed.action
  @partial = parsed.partial?
  @details = parsed.details
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



4
5
6
# File 'lib/actionview_precompiler/template_file.rb', line 4

def action
  @action
end

#detailsObject (readonly)

Returns the value of attribute details.



4
5
6
# File 'lib/actionview_precompiler/template_file.rb', line 4

def details
  @details
end

#fullpathObject (readonly)

Returns the value of attribute fullpath.



3
4
5
# File 'lib/actionview_precompiler/template_file.rb', line 3

def fullpath
  @fullpath
end

#prefixObject (readonly)

Returns the value of attribute prefix.



4
5
6
# File 'lib/actionview_precompiler/template_file.rb', line 4

def prefix
  @prefix
end

#relative_pathObject (readonly)

Returns the value of attribute relative_path.



3
4
5
# File 'lib/actionview_precompiler/template_file.rb', line 3

def relative_path
  @relative_path
end

#virtual_pathObject (readonly)

Returns the value of attribute virtual_path.



3
4
5
# File 'lib/actionview_precompiler/template_file.rb', line 3

def virtual_path
  @virtual_path
end

Instance Method Details

#partial?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/actionview_precompiler/template_file.rb', line 18

def partial?
  @partial
end