Class: Commandorobo::NoPermission
- Inherits:
-
Object
- Object
- Commandorobo::NoPermission
- Defined in:
- lib/commandorobo.rb
Overview
Class that gets returned by Command#perm_check whenever the user does not have permission.
Instance Attribute Summary collapse
-
#perm ⇒ Array
readonly
The permissions returned as an array of symbols.
Instance Method Summary collapse
-
#initialize(perm) ⇒ NoPermission
constructor
A new instance of NoPermission.
-
#prettify ⇒ Array
Generates a “pretty” array of strings for permissions.
Constructor Details
#initialize(perm) ⇒ NoPermission
Returns a new instance of NoPermission.
18 19 20 |
# File 'lib/commandorobo.rb', line 18 def initialize(perm) @perm = perm end |
Instance Attribute Details
#perm ⇒ Array (readonly)
The permissions returned as an array of symbols.
16 17 18 |
# File 'lib/commandorobo.rb', line 16 def perm @perm end |
Instance Method Details
#prettify ⇒ Array
Generates a “pretty” array of strings for permissions.
24 25 26 27 28 |
# File 'lib/commandorobo.rb', line 24 def prettify @perm.map do |t| # <hackiness> t.to_s.split(/_/).map(&:capitalize).join(' ') end # </hackiness> end |