Studitemps::Utils::URI::Base.build

Parsed documentation:
View on GitHub
Build a new URI from the given value.

@example
  ExampleURI = Studitemps::Utils::URI.build(schema: 'com.example')
  uri = ExampleURI.new(context: 'billing', resource: 'invoice', id: 'R422342')

  ExampleURI.build(uri)
  # => #<ExampleURI 'com.example:billing:invoice:R422342'>
  ExampleURI.build(context: 'billing', resource: 'invoice', id: 'R422342')
  # => #<ExampleURI 'com.example:billing:invoice:R422342'>
  ExampleURI.build('com.example:billing:invoice:R422342')
  # => #<ExampleURI 'com.example:billing:invoice:R422342'>

  # Appropriate URIs can be cast
  BillingURI =  Studitemps::Utils::URI.build(from: ExampleURI, context: 'billing')
  BillingURI.build(uri) # => #<BillingURI 'com.example:billing:invoice:R422342'>

  PayrollURI = Studitemps::Utils::URI.build(from: ExampleURI, context: 'payroll')
  PayrollURI.build(uri) # => raises Studitemps::Utils::URI::Base::InvalidURI

@raise [InvalidURI] if value can not be converted to URI
@param [Base, Hash, String] value to build URI from
@return [Base] new URI from given value
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.