Class: DIDX::Generic
- Inherits:
-
Object
- Object
- DIDX::Generic
- Defined in:
- lib/didx/generic.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#method_id ⇒ Object
readonly
Returns the value of attribute method_id.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
- #document ⇒ Object
-
#initialize(did_string) ⇒ Generic
constructor
A new instance of Generic.
Constructor Details
#initialize(did_string) ⇒ Generic
Returns a new instance of Generic.
6 7 8 9 10 11 12 |
# File 'lib/didx/generic.rb', line 6 def initialize(did_string) @id = did_string @prefix, @method, @method_id = did_string.split(":", 3) parse_method_id raise Error, "Invalid DID: #{did_string.inspect}" unless @prefix == "did" @document = nil end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/didx/generic.rb', line 5 def id @id end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
5 6 7 |
# File 'lib/didx/generic.rb', line 5 def method @method end |
#method_id ⇒ Object (readonly)
Returns the value of attribute method_id.
5 6 7 |
# File 'lib/didx/generic.rb', line 5 def method_id @method_id end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
5 6 7 |
# File 'lib/didx/generic.rb', line 5 def prefix @prefix end |