Class: AgentHarness::ExecutionPreparation::FileWrite
- Inherits:
-
Struct
- Object
- Struct
- AgentHarness::ExecutionPreparation::FileWrite
- Defined in:
- lib/agent_harness/execution_preparation.rb
Overview
Declarative file write request that executors can materialize in their own runtime environment.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path:, content:, mode: nil) ⇒ FileWrite
constructor
A new instance of FileWrite.
Constructor Details
#initialize(path:, content:, mode: nil) ⇒ FileWrite
Returns a new instance of FileWrite.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/agent_harness/execution_preparation.rb', line 13 def initialize(path:, content:, mode: nil) raise ArgumentError, "path must be a non-empty String" unless path.is_a?(String) && !path.empty? raise ArgumentError, "content must be a String" unless content.is_a?(String) if !mode.nil? && (!mode.is_a?(Integer) || mode.negative?) raise ArgumentError, "mode must be a non-negative Integer or nil" end super freeze end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
12 13 14 |
# File 'lib/agent_harness/execution_preparation.rb', line 12 def content @content end |
#mode ⇒ Object
Returns the value of attribute mode
12 13 14 |
# File 'lib/agent_harness/execution_preparation.rb', line 12 def mode @mode end |
#path ⇒ Object
Returns the value of attribute path
12 13 14 |
# File 'lib/agent_harness/execution_preparation.rb', line 12 def path @path end |