Class: Proctor::Config::TemplateFile
- Inherits:
-
Object
- Object
- Proctor::Config::TemplateFile
- Includes:
- Proctor::Config, Util::Helpers
- Defined in:
- lib/proctor/config/template_file.rb
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ TemplateFile
constructor
A new instance of TemplateFile.
- #text ⇒ Object
Methods included from Util::Helpers
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
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
11 12 13 |
# File 'lib/proctor/config/template_file.rb', line 11 def handle @handle end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/proctor/config/template_file.rb', line 11 def name @name end |
#path ⇒ Object (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
#text ⇒ Object
20 21 22 |
# File 'lib/proctor/config/template_file.rb', line 20 def text File.read(@path) end |