Class: Parxer::Validator::Base
- Inherits:
-
Object
- Object
- Parxer::Validator::Base
- Includes:
- Context
- Defined in:
- lib/parxer/validators/base_validator.rb
Direct Known Subclasses
Boolean, Custom, Datetime, Email, FileFormat, FilePresence, HeaderOrder, Inclusion, Number, Presence, RowsCount, Rut, Url
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(config = {}) ⇒ Base
constructor
A new instance of Base.
- #validate ⇒ Object
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
#config ⇒ Object (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
#id ⇒ Object
13 14 15 |
# File 'lib/parxer/validators/base_validator.rb', line 13 def id self.class.name.demodulize.tableize.singularize.to_sym end |
#validate ⇒ Object
17 18 19 |
# File 'lib/parxer/validators/base_validator.rb', line 17 def validate raise Parxer::ValidatorError.new("'validate' method not implemented") end |