Class: Cuprum::ParameterValidation::ValidationRule Private
- Inherits:
-
Struct
- Object
- Struct
- Cuprum::ParameterValidation::ValidationRule
- Defined in:
- lib/cuprum/parameter_validation/validation_rule.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Value class representing a single validation for a parameter.
Constant Summary collapse
- BLOCK_VALIDATION_TYPE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Custom validation type for a block validation.
:_block_validation- NAMED_VALIDATION_TYPE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Custom validation type for a named method validation.
:_named_method_validation
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name:, type:, method_name: nil, **options, &block) ⇒ ValidationRule
constructor
private
A new instance of ValidationRule.
Constructor Details
#initialize(name:, type:, method_name: nil, **options, &block) ⇒ ValidationRule
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ValidationRule.
28 29 30 31 32 33 34 35 36 |
# File 'lib/cuprum/parameter_validation/validation_rule.rb', line 28 def initialize(name:, type:, method_name: nil, **, &block) super( block:, method_name: method_name&.to_sym || method_name_for(name:, type:), name: name.to_sym, options:, type: type.to_sym ) end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
9 10 11 |
# File 'lib/cuprum/parameter_validation/validation_rule.rb', line 9 def block @block end |
#method_name ⇒ Object
Returns the value of attribute method_name
9 10 11 |
# File 'lib/cuprum/parameter_validation/validation_rule.rb', line 9 def method_name @method_name end |
#name ⇒ Object
Returns the value of attribute name
9 10 11 |
# File 'lib/cuprum/parameter_validation/validation_rule.rb', line 9 def name @name end |
#options ⇒ Object
Returns the value of attribute options
9 10 11 |
# File 'lib/cuprum/parameter_validation/validation_rule.rb', line 9 def end |
#type ⇒ Object
Returns the value of attribute type
9 10 11 |
# File 'lib/cuprum/parameter_validation/validation_rule.rb', line 9 def type @type end |