Class: Veri::Inputs::Base
- Inherits:
-
Object
- Object
- Veri::Inputs::Base
- Defined in:
- lib/veri/inputs/base.rb
Direct Known Subclasses
Authenticatable, Duration, HashingAlgorithm, Model, NonEmptyString, Tenant
Instance Method Summary collapse
-
#initialize(value, optional: false, error: Veri::InvalidArgumentError, message: nil) ⇒ Base
constructor
A new instance of Base.
- #process ⇒ Object
Constructor Details
#initialize(value, optional: false, error: Veri::InvalidArgumentError, message: nil) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 9 |
# File 'lib/veri/inputs/base.rb', line 4 def initialize(value, optional: false, error: Veri::InvalidArgumentError, message: nil) @value = value @optional = optional @error = error @message = end |
Instance Method Details
#process ⇒ Object
11 12 13 14 15 |
# File 'lib/veri/inputs/base.rb', line 11 def process return @value if @value.nil? && @optional processor.call end |