Class: McpAuthorization::Cache::RecorderUser
- Inherits:
-
Object
- Object
- McpAuthorization::Cache::RecorderUser
- Defined in:
- lib/mcp_authorization/cache/recorder.rb
Overview
Records can? and default_for on the wrapped user. default_for returns a value baked into the schema, so its result is part of the decision vector too, not just predicate booleans.
Instance Method Summary collapse
-
#can?(flag) ⇒ Boolean
: (untyped) -> untyped.
-
#default_for(key) ⇒ Object
: (untyped) -> untyped.
-
#initialize(target, consulted) ⇒ RecorderUser
constructor
: (untyped, Array) -> void.
-
#method_missing(name, *args, &block) ⇒ Object
: (Symbol, *untyped) -> untyped.
-
#respond_to_missing?(name, include_private = false) ⇒ Boolean
: (Symbol, ?bool) -> bool.
Constructor Details
#initialize(target, consulted) ⇒ RecorderUser
: (untyped, Array) -> void
82 83 84 85 |
# File 'lib/mcp_authorization/cache/recorder.rb', line 82 def initialize(target, consulted) @__target = target @consulted = consulted end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
: (Symbol, *untyped) -> untyped
105 106 107 |
# File 'lib/mcp_authorization/cache/recorder.rb', line 105 def method_missing(name, *args, &block) @__target.public_send(name, *args, &block) end |
Instance Method Details
#can?(flag) ⇒ Boolean
: (untyped) -> untyped
88 89 90 91 |
# File 'lib/mcp_authorization/cache/recorder.rb', line 88 def can?(flag) @consulted << Signature.new(:user, "can?", flag) @__target.can?(flag) end |
#default_for(key) ⇒ Object
: (untyped) -> untyped
94 95 96 97 |
# File 'lib/mcp_authorization/cache/recorder.rb', line 94 def default_for(key) @consulted << Signature.new(:user, "default_for", key) @__target.default_for(key) end |
#respond_to_missing?(name, include_private = false) ⇒ Boolean
: (Symbol, ?bool) -> bool
100 101 102 |
# File 'lib/mcp_authorization/cache/recorder.rb', line 100 def respond_to_missing?(name, include_private = false) @__target.respond_to?(name, include_private) end |