Class: Parxer::Validator::Base

Inherits:
Object
  • Object
show all
Includes:
Context
Defined in:
lib/parxer/validators/base_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Base

Returns a new instance of Base.



8
9
10
11
# File 'lib/parxer/validators/base_validator.rb', line 8

def initialize(config = {})
  @context = config.delete(:context)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/parxer/validators/base_validator.rb', line 6

def config
  @config
end

Instance Method Details

#idObject



13
14
15
# File 'lib/parxer/validators/base_validator.rb', line 13

def id
  self.class.name.demodulize.tableize.singularize.to_sym
end

#validateObject



17
18
19
# File 'lib/parxer/validators/base_validator.rb', line 17

def validate
  raise Parxer::ValidatorError.new("'validate' method not implemented")
end