Module: ValRequired::Method
- Included in:
- Object
- Defined in:
- lib/val_required.rb
Instance Method Summary collapse
Instance Method Details
#required!(context = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/val_required.rb', line 12 def required!(context=nil) if block_given? yield(RequiredHelper.new(context.required!)) self else raise BlankError.new("Object is not set: #{self.inspect}") unless ValRequired.set?(self) self end end |