Class: Yoti::DynamicSharingService::WantedAnchor
- Inherits:
-
Object
- Object
- Yoti::DynamicSharingService::WantedAnchor
- Defined in:
- lib/yoti/dynamic_share_service/policy/wanted_anchor.rb
Overview
A wanted anchor for a source based constraint
Instance Attribute Summary collapse
-
#sub_type ⇒ Object
readonly
Returns the value of attribute sub_type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize ⇒ WantedAnchor
constructor
A new instance of WantedAnchor.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize ⇒ WantedAnchor
Returns a new instance of WantedAnchor.
10 11 12 13 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 10 def initialize @value = '' @sub_type = nil end |
Instance Attribute Details
#sub_type ⇒ Object (readonly)
Returns the value of attribute sub_type.
8 9 10 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 8 def sub_type @sub_type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 7 def value @value end |
Class Method Details
.builder ⇒ Object
27 28 29 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 27 def self.builder WantedAnchorBuilder.new end |
Instance Method Details
#as_json ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 19 def as_json obj = { name: @value } obj[:sub_type] = @sub_type if @sub_type obj end |
#to_json(*_args) ⇒ Object
15 16 17 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 15 def to_json(*_args) as_json.to_json end |