Exception: KnowItAll::NotAuthorized

Inherits:
StandardError
  • Object
show all
Defined in:
lib/know_it_all.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(policy) ⇒ NotAuthorized

Returns a new instance of NotAuthorized.



62
63
64
# File 'lib/know_it_all.rb', line 62

def initialize(policy)
  self.policy = policy
end

Instance Attribute Details

#policyObject

Returns the value of attribute policy.



60
61
62
# File 'lib/know_it_all.rb', line 60

def policy
  @policy
end

Instance Method Details

#to_sObject



66
67
68
# File 'lib/know_it_all.rb', line 66

def to_s
  "KnowItAll::NotAuthorized: #{policy.errors.to_s}"
end