Class: Compel::Validation::CustomValidator
- Inherits:
-
Object
- Object
- Compel::Validation::CustomValidator
- Defined in:
- lib/compel/validation/conditions/if.rb
Instance Attribute Summary collapse
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(caller) ⇒ CustomValidator
constructor
A new instance of CustomValidator.
- #valid?(value) ⇒ Boolean
Constructor Details
#initialize(caller) ⇒ CustomValidator
Returns a new instance of CustomValidator.
27 28 29 |
# File 'lib/compel/validation/conditions/if.rb', line 27 def initialize(caller) ❨╯°□°❩╯︵┻━┻? caller end |
Instance Attribute Details
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
24 25 26 |
# File 'lib/compel/validation/conditions/if.rb', line 24 def caller @caller end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
24 25 26 |
# File 'lib/compel/validation/conditions/if.rb', line 24 def method @method end |
Instance Method Details
#valid?(value) ⇒ Boolean
31 32 33 |
# File 'lib/compel/validation/conditions/if.rb', line 31 def valid?(value) caller.send(method, value) end |