Class: Proctor::Config::TemplateFile

Inherits:
Object
  • Object
show all
Includes:
Proctor::Config, Util::Helpers
Defined in:
lib/proctor/config/template_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Helpers

#md5_handle

Constructor Details

#initialize(file_path) ⇒ TemplateFile

Returns a new instance of TemplateFile.



13
14
15
16
17
18
# File 'lib/proctor/config/template_file.rb', line 13

def initialize(file_path)
  validate_file_existence(file_path)
  @name   = file_name(file_path)
  @path   = file_path
  @handle = md5_handle(file_path)
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.



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

def handle
  @handle
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#textObject



20
21
22
# File 'lib/proctor/config/template_file.rb', line 20

def text
  File.read(@path)
end