Class: RailsAiBridge::Serializers::Providers::Collaborators::StackOverviewBuilder::AuthStackBuilder

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

Overview

Utility class for building auth stack lines

Class Method Summary collapse

Class Method Details

.build(auth) ⇒ String?

Builds authentication providers line

Parameters:

  • auth (Hash, nil)

    Auth hash from context

Returns:

  • (String, nil)

    Auth line or nil if unavailable



69
70
71
72
73
74
# File 'lib/rails_ai_bridge/serializers/providers/collaborators/stack_overview_builder.rb', line 69

def self.build(auth)
  return nil unless auth.is_a?(Hash) && !auth[:error]

  parts = AuthPartsExtractor.extract(auth)
  "- Auth: #{parts.join(' + ')}" if parts.any?
end