Class: OsoCloud::ParityHandle
- Inherits:
-
Object
- Object
- OsoCloud::ParityHandle
- Defined in:
- lib/oso/parity_handle.rb
Overview
ParityHandle is a testing utility in Oso Migrate for comparing expected authorization decisions with actual Oso results.
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Instance Method Summary collapse
-
#expect(expected) ⇒ nil
Expect is a public method for users to indicate the expected result of an authorization query.
-
#initialize ⇒ ParityHandle
constructor
A new instance of ParityHandle.
Constructor Details
#initialize ⇒ ParityHandle
Returns a new instance of ParityHandle.
24 25 26 27 28 |
# File 'lib/oso/parity_handle.rb', line 24 def initialize @api = nil @request_id = nil @expected = nil end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
22 23 24 |
# File 'lib/oso/parity_handle.rb', line 22 def expected @expected end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
22 23 24 |
# File 'lib/oso/parity_handle.rb', line 22 def request_id @request_id end |
Instance Method Details
#expect(expected) ⇒ nil
Expect is a public method for users to indicate the expected result of an authorization query.
55 56 57 58 59 60 61 62 |
# File 'lib/oso/parity_handle.rb', line 55 def expect(expected) raise StandardError, 'attempted to set expected result twice' unless @expected.nil? @expected = expected send_expected_result unless @request_id.nil? nil end |