Class: LanguageOperator::Dsl::ExecutionContext

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/language_operator/dsl/execution_context.rb

Overview

Execution context that includes helpers for tool execution

Provides helper methods during tool execution, allowing tools to access HTTP, Shell, Config and other utilities directly.

Examples:

Using in tool execution

context = LanguageOperator::Dsl::ExecutionContext.new(params)
context.http_get('https://example.com')
context.shell('ls -la')

Constant Summary collapse

HTTP =

Provide access to HTTP and Shell helper classes as constants

LanguageOperator::Dsl::HTTP
Shell =
LanguageOperator::Dsl::Shell

Instance Method Summary collapse

Methods included from Helpers

#env_get, #env_required, #error, #parse_csv, #run_command, #shell_escape, #success, #truncate, #validate_email, #validate_phone, #validate_url

Constructor Details

#initialize(params) ⇒ ExecutionContext

Initialize execution context with parameters

Parameters:

  • Tool execution parameters



24
25
26
# File 'lib/language_operator/dsl/execution_context.rb', line 24

def initialize(params)
  @params = params
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object

Forward missing methods to helpers

Parameters:

  • Method name

  • Method arguments



32
33
34
35
# File 'lib/language_operator/dsl/execution_context.rb', line 32

def method_missing(method, *args)
  # Allow helper methods to be called directly
  super
end

Instance Method Details

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Check if method is available

Parameters:

  • Method name

  • (defaults to: false)

    Include private methods

Returns:



42
43
44
# File 'lib/language_operator/dsl/execution_context.rb', line 42

def respond_to_missing?(method, include_private = false)
  LanguageOperator::Dsl::Helpers.instance_methods.include?(method) || super
end