Class: RailsAiContext::SchemaHint

Inherits:
Data
  • Object
show all
Defined in:
lib/rails_ai_context/schema_hint.rb

Overview

Structured hydration payload representing a model’s ground truth. Used by hydrators to inject cross-tool context into controller and view tool responses. Immutable value object via Data.define.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#associationsObject (readonly)

Returns the value of attribute associations

Returns:

  • (Object)

    the current value of associations



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def associations
  @associations
end

#columnsObject (readonly)

Returns the value of attribute columns

Returns:

  • (Object)

    the current value of columns



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def columns
  @columns
end

#confidenceObject (readonly)

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def confidence
  @confidence
end

#model_nameObject (readonly)

Returns the value of attribute model_name

Returns:

  • (Object)

    the current value of model_name



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def model_name
  @model_name
end

#primary_keyObject (readonly)

Returns the value of attribute primary_key

Returns:

  • (Object)

    the current value of primary_key



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def primary_key
  @primary_key
end

#table_nameObject (readonly)

Returns the value of attribute table_name

Returns:

  • (Object)

    the current value of table_name



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def table_name
  @table_name
end

#validationsObject (readonly)

Returns the value of attribute validations

Returns:

  • (Object)

    the current value of validations



7
8
9
# File 'lib/rails_ai_context/schema_hint.rb', line 7

def validations
  @validations
end

Instance Method Details

#association_namesObject



24
25
26
# File 'lib/rails_ai_context/schema_hint.rb', line 24

def association_names
  associations.map { |a| a[:name] }
end

#column_namesObject



20
21
22
# File 'lib/rails_ai_context/schema_hint.rb', line 20

def column_names
  columns.map { |c| c[:name] }
end

#verified?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rails_ai_context/schema_hint.rb', line 16

def verified?
  confidence == "[VERIFIED]"
end