Class: OllamaAgent::RuntimeCommandSystem::AST::CommandNode
- Inherits:
-
Object
- Object
- OllamaAgent::RuntimeCommandSystem::AST::CommandNode
- Defined in:
- lib/ollama_agent/runtime_command_system/ast.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#cursor_pos ⇒ Object
readonly
Returns the value of attribute cursor_pos.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #argument_context? ⇒ Boolean
- #command_text ⇒ Object
- #current_argument ⇒ Object
-
#initialize(name:, arguments: [], options: {}, raw: "", cursor_pos: 0) ⇒ CommandNode
constructor
A new instance of CommandNode.
Constructor Details
#initialize(name:, arguments: [], options: {}, raw: "", cursor_pos: 0) ⇒ CommandNode
Returns a new instance of CommandNode.
9 10 11 12 13 14 15 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 9 def initialize(name:, arguments: [], options: {}, raw: "", cursor_pos: 0) @name = name.to_s @arguments = arguments @options = @raw = raw.to_s @cursor_pos = cursor_pos.to_i end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
7 8 9 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 7 def arguments @arguments end |
#cursor_pos ⇒ Object (readonly)
Returns the value of attribute cursor_pos.
7 8 9 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 7 def cursor_pos @cursor_pos end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 7 def @options end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 7 def raw @raw end |
Instance Method Details
#argument_context? ⇒ Boolean
25 26 27 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 25 def argument_context? raw.include?(" ") end |
#command_text ⇒ Object
17 18 19 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 17 def command_text "/#{name}" end |
#current_argument ⇒ Object
21 22 23 |
# File 'lib/ollama_agent/runtime_command_system/ast.rb', line 21 def current_argument arguments.last end |