Class: Yoti::Sandbox::Profile::Anchor
- Inherits:
-
Object
- Object
- Yoti::Sandbox::Profile::Anchor
- Defined in:
- lib/yoti_sandbox/profile/anchor.rb
Overview
Represents an anchor that can be used by the profile sandbox service
Class Method Summary collapse
- .source(value, sub_type: '', timestamp: Time.now) ⇒ Object
- .verifier(value, sub_type: '', timestamp: Time.now) ⇒ Object
Instance Method Summary collapse
- #as_json(*_args) ⇒ Hash
-
#initialize(type:, value:, sub_type: '', timestamp: Time.now) ⇒ Anchor
constructor
A new instance of Anchor.
- #to_json(*args) ⇒ String
Constructor Details
#initialize(type:, value:, sub_type: '', timestamp: Time.now) ⇒ Anchor
Returns a new instance of Anchor.
16 17 18 19 20 21 |
# File 'lib/yoti_sandbox/profile/anchor.rb', line 16 def initialize(type:, value:, sub_type: '', timestamp: Time.now) @type = type @value = value @sub_type = sub_type @timestamp = end |
Class Method Details
Instance Method Details
#as_json(*_args) ⇒ Hash
26 27 28 29 30 31 32 33 |
# File 'lib/yoti_sandbox/profile/anchor.rb', line 26 def as_json(*_args) { type: @type, value: @value, sub_type: @sub_type, timestamp: @timestamp.strftime('%s').to_i * 1_000_000 } end |
#to_json(*args) ⇒ String
38 39 40 |
# File 'lib/yoti_sandbox/profile/anchor.rb', line 38 def to_json(*args) as_json.to_json(*args) end |