Class: Yoti::Sandbox::Profile::Attribute
- Inherits:
-
Object
- Object
- Yoti::Sandbox::Profile::Attribute
- Defined in:
- lib/yoti_sandbox/profile/attribute.rb
Overview
Represents an attribute that can be used by the profile sandbox service
Instance Method Summary collapse
- #as_json(*_args) ⇒ Hash
-
#initialize(name: '', value: '', derivation: '', anchors: []) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_json(*args) ⇒ String
Constructor Details
#initialize(name: '', value: '', derivation: '', anchors: []) ⇒ Attribute
Returns a new instance of Attribute.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/yoti_sandbox/profile/attribute.rb', line 16 def initialize( name: '', value: '', derivation: '', anchors: [] ) @name = name @value = value @derivation = derivation @anchors = anchors end |
Instance Method Details
#as_json(*_args) ⇒ Hash
31 32 33 34 35 36 37 38 |
# File 'lib/yoti_sandbox/profile/attribute.rb', line 31 def as_json(*_args) { name: @name, value: @value, derivation: @derivation, anchors: @anchors.map(&:as_json) } end |
#to_json(*args) ⇒ String
43 44 45 |
# File 'lib/yoti_sandbox/profile/attribute.rb', line 43 def to_json(*args) as_json(*args).to_json end |