Class: Validator::FileValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/makesheets/validator.rb

Overview

Class container to validate files

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ FileValidator

:notnew:



7
8
9
# File 'lib/makesheets/validator.rb', line 7

def initialize(file_name) #:notnew:

    @file_name = file_name
end

Instance Method Details

#validateObject

Validates and returns true or false

Uses the Standard File class method file

valid = Validator::File(file_name)
valid.validate


17
18
19
# File 'lib/makesheets/validator.rb', line 17

def validate
    File.file?(@file_name)
end