Class: TestServer::TemplateFile
- Inherits:
-
Object
- Object
- TestServer::TemplateFile
- Defined in:
- lib/test_server/template_file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ TemplateFile
constructor
A new instance of TemplateFile.
- #name ⇒ Object
- #read ⇒ Object
Constructor Details
#initialize(path) ⇒ TemplateFile
Returns a new instance of TemplateFile.
7 8 9 |
# File 'lib/test_server/template_file.rb', line 7 def initialize(path) @path = ::File.(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/test_server/template_file.rb', line 5 def path @path end |
Instance Method Details
#name ⇒ Object
11 12 13 |
# File 'lib/test_server/template_file.rb', line 11 def name ::File.basename(path, '.*').to_sym end |
#read ⇒ Object
15 16 17 |
# File 'lib/test_server/template_file.rb', line 15 def read ::File.read(path) end |