Class: ActionGuard::Role
- Inherits:
-
Object
- Object
- ActionGuard::Role
- Defined in:
- lib/action-guard/role.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Instance Method Summary collapse
- #<(other) ⇒ Object
- #>=(other) ⇒ Object
-
#initialize(value, level) ⇒ Role
constructor
A new instance of Role.
- #to_s ⇒ Object
Constructor Details
#initialize(value, level) ⇒ Role
Returns a new instance of Role.
4 5 6 7 |
# File 'lib/action-guard/role.rb', line 4 def initialize(value, level) @value = value @level = level end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/action-guard/role.rb', line 3 def level @level end |
Instance Method Details
#<(other) ⇒ Object
13 14 15 |
# File 'lib/action-guard/role.rb', line 13 def < (other) level > other.level end |
#>=(other) ⇒ Object
9 10 11 |
# File 'lib/action-guard/role.rb', line 9 def >=(other) level <= other.level end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/action-guard/role.rb', line 17 def to_s "Role(:#{@value})" end |