Class: Reeve::Authorization::Current::State
- Inherits:
-
Object
- Object
- Reeve::Authorization::Current::State
- Defined in:
- lib/reeve/authorization/current.rb
Overview
Mutable for exactly two reasons: recording that scoped was used, and the size of
what it scoped. Everything else about an invocation is fixed when it starts.
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#declaration ⇒ Object
readonly
Returns the value of attribute declaration.
-
#scoped_source_count ⇒ Object
Returns the value of attribute scoped_source_count.
Instance Method Summary collapse
-
#initialize(context:, declaration:, adapter:) ⇒ State
constructor
A new instance of State.
- #scoped_used! ⇒ Object
- #scoped_used? ⇒ Boolean
Constructor Details
#initialize(context:, declaration:, adapter:) ⇒ State
Returns a new instance of State.
48 49 50 51 52 53 54 |
# File 'lib/reeve/authorization/current.rb', line 48 def initialize(context:, declaration:, adapter:) @context = context @declaration = declaration @adapter = adapter @scoped_used = false @scoped_source_count = nil end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
45 46 47 |
# File 'lib/reeve/authorization/current.rb', line 45 def adapter @adapter end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
45 46 47 |
# File 'lib/reeve/authorization/current.rb', line 45 def context @context end |
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
45 46 47 |
# File 'lib/reeve/authorization/current.rb', line 45 def declaration @declaration end |
#scoped_source_count ⇒ Object
Returns the value of attribute scoped_source_count.
46 47 48 |
# File 'lib/reeve/authorization/current.rb', line 46 def scoped_source_count @scoped_source_count end |
Instance Method Details
#scoped_used! ⇒ Object
56 57 58 |
# File 'lib/reeve/authorization/current.rb', line 56 def scoped_used! @scoped_used = true end |
#scoped_used? ⇒ Boolean
60 61 62 |
# File 'lib/reeve/authorization/current.rb', line 60 def scoped_used? @scoped_used end |