Method: Addressable::URI#defer_validation
- Defined in:
- lib/vendor/addressable/lib/addressable/uri.rb
#defer_validation(&block) ⇒ Object
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.
1989 1990 1991 1992 1993 1994 1995 1996 |
# File 'lib/vendor/addressable/lib/addressable/uri.rb', line 1989 def defer_validation(&block) raise LocalJumpError, "No block given." unless block @validation_deferred = true block.call() @validation_deferred = false validate return nil end |