Class: Pairwise::InputFile
- Inherits:
-
Object
- Object
- Pairwise::InputFile
- Defined in:
- lib/pairwise/input_file.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename) ⇒ InputFile
constructor
A new instance of InputFile.
Constructor Details
#initialize(filename) ⇒ InputFile
Returns a new instance of InputFile.
15 16 17 18 |
# File 'lib/pairwise/input_file.rb', line 15 def initialize(filename) @filename = filename self.extend(input_file_module) end |
Class Method Details
.load(filename) ⇒ Object
5 6 7 8 |
# File 'lib/pairwise/input_file.rb', line 5 def load(filename) inputs = self.new(filename).load_and_parse InputData.new(inputs) if valid?(inputs) end |
.valid?(inputs) ⇒ Boolean
10 11 12 |
# File 'lib/pairwise/input_file.rb', line 10 def valid?(inputs) inputs && (inputs.is_a?(Array) || inputs.is_a?(Hash)) end |