Class: TypedParams::Validations::Validation
- Inherits:
-
Object
- Object
- TypedParams::Validations::Validation
- Defined in:
- lib/typed_params/validations/validation.rb
Class Method Summary collapse
-
.wrap(fn) ⇒ Object
wraps a callable e.g.
Instance Method Summary collapse
- #call(value) ⇒ Object
-
#initialize(options) ⇒ Validation
constructor
A new instance of Validation.
Constructor Details
#initialize(options) ⇒ Validation
Returns a new instance of Validation.
6 |
# File 'lib/typed_params/validations/validation.rb', line 6 def initialize() = @options = |
Class Method Details
.wrap(fn) ⇒ Object
wraps a callable e.g. Proc for use as a Validation
10 11 12 13 14 |
# File 'lib/typed_params/validations/validation.rb', line 10 def self.wrap(fn) return fn if fn in Validation Wrapped.new(fn) end |
Instance Method Details
#call(value) ⇒ Object
7 |
# File 'lib/typed_params/validations/validation.rb', line 7 def call(value) = raise NotImplementedError |