Class: RailsAiBridge::Serializers::Providers::CodexSupportSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_ai_bridge/serializers/providers/codex_support_serializer.rb

Overview

Writes optional helper documentation under .codex/ (e.g. README.md) for team Codex setup notes.

Does not replace AGENTS.md; use together with CodexSerializer.

Since:

  • 0.8.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ CodexSupportSerializer

Returns a new instance of CodexSupportSerializer.

Parameters:

  • context (Hash) —

    Introspection hash; uses :app_name for the generated README.

Since:

  • 0.8.0



16
17
18
# File 'lib/rails_ai_bridge/serializers/providers/codex_support_serializer.rb', line 16

def initialize(context)
  @context = context
end

Instance Attribute Details

#context ⇒ Hash (readonly)

Returns Introspection context passed to serializers.

Returns:

  • (Hash) —

    Introspection context passed to serializers.

Since:

  • 0.8.0



13
14
15
# File 'lib/rails_ai_bridge/serializers/providers/codex_support_serializer.rb', line 13

def context
  @context
end

Instance Method Details

#call(output_dir) ⇒ Hash{Symbol=>Array<String>}

Creates .codex/README.md when content differs from the existing file.

Parameters:

  • output_dir (String) —

    Absolute path to the Rails application root (or configured output directory).

Returns:

  • (Hash{Symbol=>Array<String>}) —

    :written => paths written, :skipped => paths skipped (unchanged content).

Since:

  • 0.8.0



24
25
26
# File 'lib/rails_ai_bridge/serializers/providers/codex_support_serializer.rb', line 24

def call(output_dir)
  RuleFileWriter.new(File.join(output_dir, '.codex')).call('README.md' => render_readme)
end