Class: Rabarber::Inputs::Base
- Inherits:
-
Object
- Object
- Rabarber::Inputs::Base
- Defined in:
- lib/rabarber/inputs/base.rb
Direct Known Subclasses
Boolean, Context, DynamicRule, Model, NonEmptyString, NonEmptySymbol, Role, Roles
Instance Method Summary collapse
-
#initialize(value, optional: false, error: Rabarber::InvalidArgumentError, message: nil) ⇒ Base
constructor
A new instance of Base.
- #process ⇒ Object
Constructor Details
#initialize(value, optional: false, error: Rabarber::InvalidArgumentError, message: nil) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/rabarber/inputs/base.rb', line 6 def initialize(value, optional: false, error: Rabarber::InvalidArgumentError, message: nil) @value = value @optional = optional @error = error @message = end |
Instance Method Details
#process ⇒ Object
13 14 15 16 17 |
# File 'lib/rabarber/inputs/base.rb', line 13 def process return @value if @value.nil? && @optional validate_and_normalize end |