Class: Proctor::Config::TemplateFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/proctor/config/template_files.rb

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ TemplateFiles

Returns a new instance of TemplateFiles.



7
8
9
# File 'lib/proctor/config/template_files.rb', line 7

def initialize (params)
  @all = path_list(params).map {|f| TemplateFile.new(f)}
end

Instance Method Details

#allObject



11
12
13
# File 'lib/proctor/config/template_files.rb', line 11

def all
  @all.sort {|a,b| a.name <=> b.name}
end

#find_by_handle(handle) ⇒ Object



19
20
21
# File 'lib/proctor/config/template_files.rb', line 19

def find_by_handle(handle)
  @all.find {|template_file| template_file.handle == handle}
end

#find_by_name(file_name) ⇒ Object



15
16
17
# File 'lib/proctor/config/template_files.rb', line 15

def find_by_name(file_name)
  @all.find {|template_file| template_file.name == file_name}
end

#namesObject



23
24
25
# File 'lib/proctor/config/template_files.rb', line 23

def names
  @all.map {|template| template.name}
end