Class: UseCaseValidations::CustomValidator
- Defined in:
- lib/usecasing_validations/custom_validator.rb
Instance Attribute Summary collapse
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
Attributes inherited from Validator
Instance Method Summary collapse
-
#initialize(args) ⇒ CustomValidator
constructor
A new instance of CustomValidator.
- #validate(record) ⇒ Object
Constructor Details
#initialize(args) ⇒ CustomValidator
Returns a new instance of CustomValidator.
7 8 9 10 11 |
# File 'lib/usecasing_validations/custom_validator.rb', line 7 def initialize(args) = Helpers.(args) @methods = args super() end |
Instance Attribute Details
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
5 6 7 |
# File 'lib/usecasing_validations/custom_validator.rb', line 5 def methods @methods end |
Instance Method Details
#validate(record) ⇒ Object
13 14 15 16 17 |
# File 'lib/usecasing_validations/custom_validator.rb', line 13 def validate(record) [*methods].map do |method| base.send(method, record) end.all? end |