Sha256: a96579f2a69c90418337d54599cffcfa2d55f92d2d29b3fa795fe8d8f567105c

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 Bytes

Contents

require 'squib/args/arg_loader'

module Squib
  # @api private
  module Args

    class InputFile
      include ArgLoader

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

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

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

      def self.params_with_units
        [] # none of them
      end

      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

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
squib-0.9.0 lib/squib/args/input_file.rb