Class: ActionviewPrecompiler::Precompiler::Template

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fullpath, relative_path) ⇒ Template

Returns a new instance of Template.



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

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.



5
6
7
# File 'lib/actionview_precompiler/precompiler.rb', line 5

def action
  @action
end

#detailsObject (readonly)

Returns the value of attribute details.



5
6
7
# File 'lib/actionview_precompiler/precompiler.rb', line 5

def details
  @details
end

#fullpathObject (readonly)

Returns the value of attribute fullpath.



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

def fullpath
  @fullpath
end

#prefixObject (readonly)

Returns the value of attribute prefix.



5
6
7
# File 'lib/actionview_precompiler/precompiler.rb', line 5

def prefix
  @prefix
end

#relative_pathObject (readonly)

Returns the value of attribute relative_path.



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

def relative_path
  @relative_path
end

#virtual_pathObject (readonly)

Returns the value of attribute virtual_path.



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

def virtual_path
  @virtual_path
end

Instance Method Details

#partial?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/actionview_precompiler/precompiler.rb', line 19

def partial?
  @partial
end