Class: ResourcePolicy::Policy::MergePolicies

Inherits:
Object
  • Object
show all
Defined in:
lib/resource_policy/policy/merge_policies.rb

Overview

Service object using for merging two policy configurations

Defined Under Namespace

Classes: OverlappingActionError

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(policy, other_policy) ⇒ MergePolicies

Returns a new instance of MergePolicies.



13
14
15
16
# File 'lib/resource_policy/policy/merge_policies.rb', line 13

def initialize(policy, other_policy)
  @policy = policy
  @other_policy = other_policy
end

Class Method Details

.call(*args) ⇒ Object



9
10
11
# File 'lib/resource_policy/policy/merge_policies.rb', line 9

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



18
19
20
21
22
# File 'lib/resource_policy/policy/merge_policies.rb', line 18

def call
  merge_actions
  merge_attributes
  policy
end