Class: TextDataTools::Named::DataFile
- Inherits:
-
DataFileBase
- Object
- DataFileBase
- TextDataTools::Named::DataFile
- Defined in:
- lib/text-data-tools.rb
Overview
This is a simple class which can interface with the methods of TextDataTools::Named to prevent the user having to specify the file name and other properties of the data file for every call. In a nutshell, create a new instance of this class giving it the filename, and any appropriate options, then call methods from TextDataTools omitting the appropriate arguments.
Instance Method Summary collapse
- #get_variable_value(name) ⇒ Object
-
#initialize(filename, sep = ':') ⇒ DataFile
constructor
A new instance of DataFile.
Methods inherited from DataFileBase
Constructor Details
#initialize(filename, sep = ':') ⇒ DataFile
Returns a new instance of DataFile.
230 231 232 233 234 |
# File 'lib/text-data-tools.rb', line 230 def initialize(filename, sep = ':') @filename = filename @sep = sep self end |
Instance Method Details
#get_variable_value(name) ⇒ Object
235 236 237 |
# File 'lib/text-data-tools.rb', line 235 def get_variable_value(name) TextDataTools::Named.get_variable_value(@filename, name, @sep) end |