Class: Yoti::DynamicSharingService::WantedAnchorBuilder
- Inherits:
-
Object
- Object
- Yoti::DynamicSharingService::WantedAnchorBuilder
- Defined in:
- lib/yoti/dynamic_share_service/policy/wanted_anchor.rb
Overview
Builder for WantedAnchor
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ WantedAnchorBuilder
constructor
A new instance of WantedAnchorBuilder.
- #with_sub_type(sub_type = nil) ⇒ Object
- #with_value(value) ⇒ Object
Constructor Details
#initialize ⇒ WantedAnchorBuilder
Returns a new instance of WantedAnchorBuilder.
34 35 36 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 34 def initialize @anchor = WantedAnchor.new end |
Instance Method Details
#build ⇒ Object
48 49 50 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 48 def build Marshal.load Marshal.dump @anchor end |
#with_sub_type(sub_type = nil) ⇒ Object
43 44 45 46 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 43 def with_sub_type(sub_type = nil) @anchor.instance_variable_set(:@sub_type, sub_type) self end |
#with_value(value) ⇒ Object
38 39 40 41 |
# File 'lib/yoti/dynamic_share_service/policy/wanted_anchor.rb', line 38 def with_value(value) @anchor.instance_variable_set(:@value, value) self end |