Class: Aegis::Role
- Inherits:
-
Object
- Object
- Aegis::Role
- Defined in:
- lib/aegis/role.rb
Instance Attribute Summary collapse
-
#default_permission ⇒ Object
readonly
Returns the value of attribute default_permission.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(name, options) ⇒ Role
constructor
A new instance of Role.
- #may_by_default? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(name, options) ⇒ Role
Returns a new instance of Role.
6 7 8 9 10 |
# File 'lib/aegis/role.rb', line 6 def initialize(name, ) @name = name @default_permission = [:default_permission] == :allow ? :allow : :deny freeze end |
Instance Attribute Details
#default_permission ⇒ Object (readonly)
Returns the value of attribute default_permission.
4 5 6 |
# File 'lib/aegis/role.rb', line 4 def @default_permission end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/aegis/role.rb', line 4 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/aegis/role.rb', line 16 def <=>(other) name <=> other.name end |
#may_by_default? ⇒ Boolean
12 13 14 |
# File 'lib/aegis/role.rb', line 12 def may_by_default? @default_permission == :allow end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/aegis/role.rb', line 20 def to_s name.to_s.humanize end |