Exception: Yay::NotAllowedError

Inherits:
Error
  • Object
show all
Defined in:
lib/yay/errors.rb

Overview

this is a generic access control error that’s raised when someoen tries to do something disallowed in their current context. for example, you can use the install command from the command line but not a yayfile

Instance Attribute Summary collapse

Attributes inherited from Error

#position

Instance Method Summary collapse

Methods inherited from Error

#printable_position

Constructor Details

#initialize(action, path) ⇒ NotAllowedError

Returns a new instance of NotAllowedError.



82
83
84
85
# File 'lib/yay/errors.rb', line 82

def initialize action, path
  @action = action
  @path   = path
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



79
80
81
# File 'lib/yay/errors.rb', line 79

def action
  @action
end

#pathObject (readonly)

Returns the value of attribute path.



80
81
82
# File 'lib/yay/errors.rb', line 80

def path
  @path
end

Instance Method Details

#printable_messageObject



87
88
89
# File 'lib/yay/errors.rb', line 87

def printable_message
  return "You can't #{action} from here"
end