Class: RailsAiContext::Serializers::JsonSerializer
- Inherits:
-
Object
- Object
- RailsAiContext::Serializers::JsonSerializer
- Defined in:
- lib/rails_ai_context/serializers/json_serializer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(context) ⇒ JsonSerializer
constructor
A new instance of JsonSerializer.
Constructor Details
#initialize(context) ⇒ JsonSerializer
Returns a new instance of JsonSerializer.
10 11 12 |
# File 'lib/rails_ai_context/serializers/json_serializer.rb', line 10 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
8 9 10 |
# File 'lib/rails_ai_context/serializers/json_serializer.rb', line 8 def context @context end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'lib/rails_ai_context/serializers/json_serializer.rb', line 14 def call JSON.pretty_generate(context) end |