Class: RosettAi::Compiler::CompiledOutput
- Inherits:
-
Struct
- Object
- Struct
- RosettAi::Compiler::CompiledOutput
- Defined in:
- lib/rosett_ai/compiler/compiled_output.rb
Overview
Value object representing a single compiled output file.
Replaces the raw Hash previously returned by BehaviourCompiler#compile. Struct supports both .field and [:field] access, so callers using info[:content] continue to work without modification.
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#content ⇒ Object
Returns the value of attribute content.
-
#enabled_rules_count ⇒ Object
Returns the value of attribute enabled_rules_count.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rules_count ⇒ Object
Returns the value of attribute rules_count.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#source ⇒ Object
Returns the value of attribute source.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#to_lockfile_hash(display_path:, source_path:, content_checksum:, timestamp:) ⇒ Hash
Builds a lockfile entry hash for this compiled output.
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def category @category end |
#content ⇒ Object
Returns the value of attribute content
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def content @content end |
#enabled_rules_count ⇒ Object
Returns the value of attribute enabled_rules_count
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def enabled_rules_count @enabled_rules_count end |
#filename ⇒ Object
Returns the value of attribute filename
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def filename @filename end |
#name ⇒ Object
Returns the value of attribute name
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def name @name end |
#rules_count ⇒ Object
Returns the value of attribute rules_count
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def rules_count @rules_count end |
#scope ⇒ Object
Returns the value of attribute scope
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def scope @scope end |
#source ⇒ Object
Returns the value of attribute source
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def source @source end |
#version ⇒ Object
Returns the value of attribute version
13 14 15 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 13 def version @version end |
Instance Method Details
#to_lockfile_hash(display_path:, source_path:, content_checksum:, timestamp:) ⇒ Hash
Builds a lockfile entry hash for this compiled output.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rosett_ai/compiler/compiled_output.rb', line 24 def to_lockfile_hash(display_path:, source_path:, content_checksum:, timestamp:) entry = { 'version' => version, 'source' => source_path, 'output' => "#{display_path}/#{filename}", 'checksum' => "sha256:#{content_checksum}", 'compiled_at' => , 'rules_count' => rules_count, 'enabled_rules_count' => enabled_rules_count } entry['scope'] = scope if scope entry end |