Class: DIDX::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/didx/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_json_string) ⇒ Document

Returns a new instance of Document.



7
8
9
10
11
12
13
14
15
# File 'lib/didx/document.rb', line 7

def initialize(document_json_string)
  @document = JSON.parse(document_json_string)
  @context = document["@context"]
  @id = document["id"]
  @service = document["service"]
  @verification_method = document["verificationMethod"]
  @authentication = document["authentication"]
  @assertion_method = document["assertionMethod"]
end

Instance Attribute Details

#assertion_methodObject (readonly)

Returns the value of attribute assertion_method.



4
5
6
# File 'lib/didx/document.rb', line 4

def assertion_method
  @assertion_method
end

#authenticationObject (readonly)

Returns the value of attribute authentication.



4
5
6
# File 'lib/didx/document.rb', line 4

def authentication
  @authentication
end

#contextObject (readonly)

Returns the value of attribute context.



4
5
6
# File 'lib/didx/document.rb', line 4

def context
  @context
end

#documentObject (readonly)

Returns the value of attribute document.



4
5
6
# File 'lib/didx/document.rb', line 4

def document
  @document
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/didx/document.rb', line 4

def id
  @id
end

#serviceObject (readonly)

Returns the value of attribute service.



4
5
6
# File 'lib/didx/document.rb', line 4

def service
  @service
end

#verification_methodObject (readonly)

Returns the value of attribute verification_method.



4
5
6
# File 'lib/didx/document.rb', line 4

def verification_method
  @verification_method
end