Class: Squib::Args::InputFile Private

Inherits:
Object
  • Object
show all
Includes:
ArgLoader
Defined in:
lib/squib/args/input_file.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ArgLoader

#[], #convert_units, #defaultify, #expand_and_set_and_defaultify, #expandable_singleton?, #load!, #prep_layout_args, #validate

Constructor Details

#initialize(dsl_method_default = {}) ⇒ InputFile

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InputFile



10
11
12
# File 'lib/squib/args/input_file.rb', line 10

def initialize(dsl_method_default = {})
  @dsl_method_default = dsl_method_default
end

Class Method Details

.expanding_parametersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/squib/args/input_file.rb', line 20

def self.expanding_parameters
  parameters.keys # all of them
end

.parametersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
# File 'lib/squib/args/input_file.rb', line 14

def self.parameters
  { file: nil,
    sheet: 0,
  }
end

.params_with_unitsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/squib/args/input_file.rb', line 24

def self.params_with_units
  [] # none of them
end

Instance Method Details

#validate_file(arg, _i) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
31
32
# File 'lib/squib/args/input_file.rb', line 28

def validate_file(arg, _i)
  return nil if arg.nil?
  raise "File #{File.expand_path(arg)} does not exist!" unless File.exists?(arg)
  File.expand_path(arg)
end