Class: WritersRoom::ProjectTool

Inherits:
RobotLab::Tool
  • Object
show all
Defined in:
lib/writers_room/tools/project_tool.rb

Overview

Base class for tools that operate on files within a project directory. Enforces that all file access stays within the project root.

Direct Known Subclasses

ListDirectoryTool, ReadFileTool, WriteFileTool

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path:, robot: nil) ⇒ ProjectTool

Returns a new instance of ProjectTool.



11
12
13
14
# File 'lib/writers_room/tools/project_tool.rb', line 11

def initialize(project_path:, robot: nil)
  super(robot: robot)
  @project_path = File.expand_path(project_path)
end

Instance Attribute Details

#project_pathObject (readonly)

Returns the value of attribute project_path.



9
10
11
# File 'lib/writers_room/tools/project_tool.rb', line 9

def project_path
  @project_path
end