Class: FiletypeValidation::BaseValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/filetype_validation/base_validator.rb

Overview

base validator for file types

Direct Known Subclasses

CsvValidator, PlaintextValidator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ BaseValidator

Returns a new instance of BaseValidator.



6
7
8
9
# File 'lib/filetype_validation/base_validator.rb', line 6

def initialize(file, options = {})
  @file = File.new(file)
  @options = options
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



4
5
6
# File 'lib/filetype_validation/base_validator.rb', line 4

def file
  @file
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/filetype_validation/base_validator.rb', line 4

def options
  @options
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/filetype_validation/base_validator.rb', line 11

def valid?
  raise NotImplementedError
end