Module: URI::URN

Defined in:
lib/uri/urn.rb,
lib/uri/urn/isbn.rb,
lib/uri/urn/uuid.rb

Defined Under Namespace

Classes: Generic, ISBN, UUID

Constant Summary collapse

COMPONENT =
[:scheme, :nid, :nss]
@@nids =
Hash.new(URN::Generic)

Class Method Summary collapse

Class Method Details

.build(args) ⇒ Object



16
17
18
19
# File 'lib/uri/urn.rb', line 16

def self.build(args)
  tmp = Util.make_components_hash(self, args)
  @@nids[tmp[:nid].to_s.upcase].build(tmp)
end

.componentObject



7
8
9
# File 'lib/uri/urn.rb', line 7

def self.component
  COMPONENT
end

.new(*arg) ⇒ Object



11
12
13
14
# File 'lib/uri/urn.rb', line 11

def self.new(*arg)
  nid = (md = arg[6].to_s.match(Generic::URN_REGEXP)) && md['nid']
  @@nids[nid.to_s.upcase].new(*arg)
end

.nid_listObject



115
116
117
# File 'lib/uri/urn.rb', line 115

def self.nid_list
  @@nids
end