Class: TestServer::TemplateFile

Inherits:
Object
  • Object
show all
Defined in:
lib/test_server/template_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.expand_path(path)
end

Instance Attribute Details

#pathObject (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

#nameObject



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

def name
  ::File.basename(path, '.*').to_sym
end

#readObject



15
16
17
# File 'lib/test_server/template_file.rb', line 15

def read
  ::File.read(path)
end