Exception: Policy::Follower::NameError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Policy::Follower::NameError
- Defined in:
- lib/policy/follower/name_error.rb
Overview
An exception to be risen when a policy name is not followed by a follower
Instance Attribute Summary collapse
-
#follower ⇒ Class
readonly
The follower class that doesn’t follow given policy.
-
#name ⇒ String
readonly
The name of the policy that is not followed by the follower.
Class Method Summary collapse
-
.initialize(follower, name) ⇒ Policy::Follower::NameError
Constructs an exception for the follower class and the policy name.
Instance Method Summary collapse
-
#inspect ⇒ String
The human-readable description for the exception.
-
#message ⇒ String
The human-readable exception message.
-
#new(follower, name) ⇒ Policy::Follower::NameError
Constructs an exception for the follower class and the policy name.
Instance Attribute Details
#follower ⇒ Class (readonly)
The follower class that doesn’t follow given policy
27 28 29 |
# File 'lib/policy/follower/name_error.rb', line 27 def follower @follower end |
#name ⇒ String (readonly)
The name of the policy that is not followed by the follower
33 34 35 |
# File 'lib/policy/follower/name_error.rb', line 33 def name @name end |
Class Method Details
.initialize(follower, name) ⇒ Policy::Follower::NameError
Constructs an exception for the follower class and the policy name
18 19 20 21 |
# File 'lib/policy/follower/name_error.rb', line 18 def initialize(follower, name) @follower = follower @name = name.to_sym end |
Instance Method Details
#inspect ⇒ String
The human-readable description for the exception
45 46 47 |
# File 'lib/policy/follower/name_error.rb', line 45 def inspect "#<#{ self }: #{ }>" end |
#message ⇒ String
The human-readable exception message
38 39 40 |
# File 'lib/policy/follower/name_error.rb', line 38 def "#{ follower.inspect } hasn't registered the policy \"#{ name }\"" end |
#new(follower, name) ⇒ Policy::Follower::NameError
Constructs an exception for the follower class and the policy name
18 19 20 21 |
# File 'lib/policy/follower/name_error.rb', line 18 def initialize(follower, name) @follower = follower @name = name.to_sym end |