Class: ParamsChecker::ParamChecker::BaseParamChecker
- Inherits:
-
Object
- Object
- ParamsChecker::ParamChecker::BaseParamChecker
- Defined in:
- lib/params_checker/param_checker.rb
Direct Known Subclasses
ArrParamChecker, BooleanChecker, CharParamChecker, DateParamChecker, DateTimeParamChecker, EmailParamChecker, IntParamChecker, NumParamChecker, TimeParamChecker
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#key ⇒ Object
Returns the value of attribute key.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
- #add_error(message = '') ⇒ Object
- #call ⇒ Object
-
#initialize(key = '', fields = {}, opts = {}) ⇒ BaseParamChecker
constructor
A new instance of BaseParamChecker.
Constructor Details
#initialize(key = '', fields = {}, opts = {}) ⇒ BaseParamChecker
Returns a new instance of BaseParamChecker.
4 5 6 7 8 |
# File 'lib/params_checker/param_checker.rb', line 4 def initialize(key = '', fields = {}, opts = {}) @key = key @fields = fields @opts = opts end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
16 17 18 |
# File 'lib/params_checker/param_checker.rb', line 16 def fields @fields end |
#key ⇒ Object
Returns the value of attribute key.
16 17 18 |
# File 'lib/params_checker/param_checker.rb', line 16 def key @key end |
#opts ⇒ Object
Returns the value of attribute opts.
16 17 18 |
# File 'lib/params_checker/param_checker.rb', line 16 def opts @opts end |
Instance Method Details
#add_error(message = '') ⇒ Object
12 13 14 |
# File 'lib/params_checker/param_checker.rb', line 12 def add_error( = '') errors.add(key, ) end |
#call ⇒ Object
10 |
# File 'lib/params_checker/param_checker.rb', line 10 def call; end |