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.
- #inspect ⇒ Object
Methods inherited from DataFileBase
Constructor Details
#initialize(filename, sep = ':') ⇒ DataFile
Returns a new instance of DataFile.
239 240 241 242 243 |
# File 'lib/text-data-tools.rb', line 239 def initialize(filename, sep = ':') @filename = filename @sep = sep self end |
Instance Method Details
#get_variable_value(name) ⇒ Object
247 248 249 |
# File 'lib/text-data-tools.rb', line 247 def get_variable_value(name) TextDataTools::Named.get_variable_value(@filename, name, @sep) end |
#inspect ⇒ Object
244 245 246 |
# File 'lib/text-data-tools.rb', line 244 def inspect "#{self.class}.new(#{@filename.inspect}, #{@sep.inspect})" end |