Class: ParamsChecker::ParamChecker::BaseParamChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/params_checker/param_checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fieldsObject

Returns the value of attribute fields.



16
17
18
# File 'lib/params_checker/param_checker.rb', line 16

def fields
  @fields
end

#keyObject

Returns the value of attribute key.



16
17
18
# File 'lib/params_checker/param_checker.rb', line 16

def key
  @key
end

#optsObject

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(message = '')
    errors.add(key, message)
end

#callObject



10
# File 'lib/params_checker/param_checker.rb', line 10

def call; end