Module: RubyLLM::MCP::Handlers::Concerns::GuardChecks::ClassMethods
- Defined in:
- lib/ruby_llm/mcp/handlers/concerns/guard_checks.rb
Instance Method Summary collapse
-
#guard(method_name) ⇒ Object
Register a guard method that must return true to proceed.
-
#guards ⇒ Object
Store guard methods.
-
#inherited(subclass) ⇒ Object
Inherit guards from parent classes.
Instance Method Details
#guard(method_name) ⇒ Object
Register a guard method that must return true to proceed
16 17 18 |
# File 'lib/ruby_llm/mcp/handlers/concerns/guard_checks.rb', line 16 def guard(method_name) guards << method_name end |
#guards ⇒ Object
Store guard methods
21 22 23 |
# File 'lib/ruby_llm/mcp/handlers/concerns/guard_checks.rb', line 21 def guards @guards ||= [] end |
#inherited(subclass) ⇒ Object
Inherit guards from parent classes
26 27 28 29 |
# File 'lib/ruby_llm/mcp/handlers/concerns/guard_checks.rb', line 26 def inherited(subclass) super subclass.instance_variable_set(:@guards, guards.dup) end |