Class: Stall::ViewGenerator::ViewTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/stall/view/view_generator.rb

Defined Under Namespace

Classes: ViewNotFound

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ ViewTemplate

Returns a new instance of ViewTemplate.



22
23
24
# File 'lib/generators/stall/view/view_generator.rb', line 22

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



20
21
22
# File 'lib/generators/stall/view/view_generator.rb', line 20

def file_path
  @file_path
end

Instance Method Details

#source_pathObject



26
27
28
# File 'lib/generators/stall/view/view_generator.rb', line 26

def source_path
  source_file_for(file_path_with_ext)
end

#target_pathObject



30
31
32
# File 'lib/generators/stall/view/view_generator.rb', line 30

def target_path
  "app/views/#{ file_path_with_ext }"
end