Module: DIDX

Defined in:
lib/didx.rb,
lib/didx/key.rb,
lib/didx/web.rb,
lib/didx/generic.rb,
lib/didx/version.rb,
lib/didx/document.rb

Defined Under Namespace

Classes: Document, Error, Generic, Key, Web

Constant Summary collapse

REGISTRY =
{
  "web" => DIDX::Web
}.freeze
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.default_split(did_string) ⇒ Object



27
28
29
# File 'lib/didx.rb', line 27

def self.default_split(did_string)
  did_string.split(":", 3)
end

.parse(did_string) ⇒ Object



17
18
19
20
21
# File 'lib/didx.rb', line 17

def self.parse(did_string)
  did_method = parse_method(did_string)
  did_method_class = self::REGISTRY[did_method]
  did_method_class.new(did_string)
end

.parse_method(did_string) ⇒ Object



23
24
25
# File 'lib/didx.rb', line 23

def self.parse_method(did_string)
  default_split(did_string)[1]
end