Module: Studitemps::Utils::URI

Defined in:
lib/studitemps/utils/uri.rb,
lib/studitemps/utils/uri/base.rb,
lib/studitemps/utils/uri/builder.rb,
lib/studitemps/utils/uri/extensions/types.rb,
lib/studitemps/utils/uri/extensions/base64.rb,
lib/studitemps/utils/uri/extensions/aliases.rb,
lib/studitemps/utils/uri/extensions/serialization.rb,
lib/studitemps/utils/uri/extensions/string_equality.rb

Overview

Studitemps URI

Since:

  • 0.1.0

Defined Under Namespace

Modules: Extensions Classes: Base, Builder

Class Method Summary collapse

Class Method Details

.build(schema: nil, context: nil, resource: nil, from: Base) ⇒ Base

Build a new Studitemps URI class from some base class.

Examples:

Basic usage

require 'studitemps/utils/uri'

ExampleURI = Studitemps::Utils::URI.build(schema: 'com.example')

ExampleURI.new # => #<ExampleURI 'com.example'>

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

uri.to_s # => 'com.example:billing:invoice:R422342'

ExampleURI.build('com.example:billing:invoice:R422342')
# => #<ExampleURI 'com.example:billing:invoice:R422342'>

Since:

  • 0.1.0


44
45
46
# File 'lib/studitemps/utils/uri.rb', line 44

def build(schema: nil, context: nil, resource: nil, from: Base)
  Builder.new.call(schema: schema, context: context, resource: resource, superclass: from)
end