Class: Policy::Follower::FollowedPolicies Private

Inherits:
Hash
  • Object
show all
Defined in:
lib/policy/follower/followed_policies.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Describes the list of followed policies

Instance Method Summary collapse

Instance Method Details

#add(policy) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers followed policy with given unique key

Parameters:

Returns:

  • (undefined)

17
18
19
# File 'lib/policy/follower/followed_policies.rb', line 17

def add(policy)
  self[policy.name] = policy
end

#apply_to(follower, *names) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Applies to follower the policies, selected by names

Parameters:

Returns:

  • (undefined)

Raises:


30
31
32
# File 'lib/policy/follower/followed_policies.rb', line 30

def apply_to(follower, *names)
  named_by(names).each { |policy| policy.apply_to(follower) }
end