Class: Chainpoint::ProofHandle
- Inherits:
-
Object
- Object
- Chainpoint::ProofHandle
- Defined in:
- lib/chainpoint/proof_handle.rb
Instance Attribute Summary collapse
-
#node_hash_id ⇒ Object
readonly
Returns the value of attribute node_hash_id.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, node_hash_id) ⇒ ProofHandle
constructor
A new instance of ProofHandle.
- #proof ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(uri, node_hash_id) ⇒ ProofHandle
Returns a new instance of ProofHandle
7 8 9 10 11 12 13 |
# File 'lib/chainpoint/proof_handle.rb', line 7 def initialize(uri, node_hash_id) raise ArgumentError, 'Proof Handle uri not specified' unless uri raise ArgumentError, 'Proof Handle node_hash_id not specified' unless node_hash_id @uri = uri @node_hash_id = node_hash_id end |
Instance Attribute Details
#node_hash_id ⇒ Object (readonly)
Returns the value of attribute node_hash_id
5 6 7 |
# File 'lib/chainpoint/proof_handle.rb', line 5 def node_hash_id @node_hash_id end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri
5 6 7 |
# File 'lib/chainpoint/proof_handle.rb', line 5 def uri @uri end |
Instance Method Details
#proof ⇒ Object
15 16 17 18 19 20 |
# File 'lib/chainpoint/proof_handle.rb', line 15 def proof data = request_proof return unless data['proof'] Chainpoint::Proof.new(data['proof'], data['hash_id_node'], data['anchors_complete']) end |
#to_h ⇒ Object
22 23 24 |
# File 'lib/chainpoint/proof_handle.rb', line 22 def to_h { uri: @uri, node_hash_id: @node_hash_id } end |