Sha256: 37b496bff2e268f99be9edea18ee1cdf7daf2a87d879f4bf4b3d32947d8f1e89
Contents?: true
Size: 645 Bytes
Versions: 2
Compression:
Stored size: 645 Bytes
Contents
require 'command_mapper/types/input_path' module CommandMapper module Types # # Represents a path to an existing file. # class InputFile < InputPath # # Validates the file exists. # # @param [Object] value # # @return [true, (false, String)] # def validate(value) valid, message = super(value) unless valid return valid, message end unless value.empty? unless File.file?(value) return [false, "file does not exist (#{value.inspect})"] end end return true end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
command_mapper-0.1.0 | lib/command_mapper/types/input_file.rb |
command_mapper-0.1.0.pre1 | lib/command_mapper/types/input_file.rb |