Module: Serega::SeregaValidations::CheckAttributeParams::InstanceMethods
- Included in:
- Serega::SeregaValidations::CheckAttributeParams
- Defined in:
- lib/serega/validations/check_attribute_params.rb
Overview
Validations for attribute params instance methods
Instance Attribute Summary collapse
-
#block ⇒ nil, Proc
readonly
Validated attribute block.
-
#name ⇒ Symbol
readonly
Validated attribute name.
-
#opts ⇒ Hash
readonly
Validated attribute options.
Instance Method Summary collapse
-
#initialize(name, opts, block) ⇒ void
Initializes attribute params validator.
-
#validate ⇒ Object
Validates attribute params.
Instance Attribute Details
#block ⇒ nil, Proc (readonly)
Returns validated attribute block.
26 27 28 |
# File 'lib/serega/validations/check_attribute_params.rb', line 26 def block @block end |
#name ⇒ Symbol (readonly)
Returns validated attribute name.
20 21 22 |
# File 'lib/serega/validations/check_attribute_params.rb', line 20 def name @name end |
#opts ⇒ Hash (readonly)
Returns validated attribute options.
23 24 25 |
# File 'lib/serega/validations/check_attribute_params.rb', line 23 def opts @opts end |
Instance Method Details
#initialize(name, opts, block) ⇒ void
Initializes attribute params validator
37 38 39 40 41 |
# File 'lib/serega/validations/check_attribute_params.rb', line 37 def initialize(name, opts, block) @name = name @opts = opts @block = block end |
#validate ⇒ Object
Validates attribute params
46 47 48 49 50 |
# File 'lib/serega/validations/check_attribute_params.rb', line 46 def validate check_name if check_attribute_name check_opts check_block end |