Class: Roleback::OutcomeBase
- Inherits:
-
Object
- Object
- Roleback::OutcomeBase
- Defined in:
- lib/roleback/outcome.rb
Instance Attribute Summary collapse
-
#outcome ⇒ Object
readonly
Returns the value of attribute outcome.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #allowed? ⇒ Boolean
- #denied? ⇒ Boolean
-
#initialize(outcome) ⇒ OutcomeBase
constructor
A new instance of OutcomeBase.
- #to_s ⇒ Object
Constructor Details
#initialize(outcome) ⇒ OutcomeBase
Returns a new instance of OutcomeBase.
5 6 7 |
# File 'lib/roleback/outcome.rb', line 5 def initialize(outcome) @outcome = outcome end |
Instance Attribute Details
#outcome ⇒ Object (readonly)
Returns the value of attribute outcome.
3 4 5 |
# File 'lib/roleback/outcome.rb', line 3 def outcome @outcome end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 24 25 |
# File 'lib/roleback/outcome.rb', line 21 def ==(other) return false unless other.respond_to?(:outcome) other.outcome == outcome end |
#allowed? ⇒ Boolean
9 10 11 |
# File 'lib/roleback/outcome.rb', line 9 def allowed? @outcome == :allow end |
#denied? ⇒ Boolean
13 14 15 |
# File 'lib/roleback/outcome.rb', line 13 def denied? @outcome == :deny end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/roleback/outcome.rb', line 17 def to_s @outcome.to_s end |