Class: Yoti::DynamicSharingService::WantedAnchor

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti/dynamic_share_service/policy/wanted_anchor.rb

Overview

A wanted anchor for a source based constraint

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWantedAnchor

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_typeObject (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

#valueObject (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

.builderObject



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_jsonObject



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