Method: Addressable::URI#defer_validation

Defined in:
lib/addressable/uri.rb

#defer_validationObject

This method allows you to make several changes to a URI simultaneously, which separately would cause validation errors, but in conjunction, are valid. The URI will be revalidated as soon as the entire block has been executed.



2396
2397
2398
2399
2400
2401
2402
2403
2404
# File 'lib/addressable/uri.rb', line 2396

def defer_validation
  raise LocalJumpError, "No block given." unless block_given?
  @validation_deferred = true
  yield
  @validation_deferred = false
  validate
ensure
  @validation_deferred = false
end