Class: RailsOrchestrator::Message
- Inherits:
-
Object
- Object
- RailsOrchestrator::Message
- Defined in:
- lib/rails_orchestrator/message.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(role:, content:) ⇒ Message
constructor
A new instance of Message.
- #to_h ⇒ Object
Constructor Details
#initialize(role:, content:) ⇒ Message
Returns a new instance of Message.
7 8 9 10 |
# File 'lib/rails_orchestrator/message.rb', line 7 def initialize(role:, content:) @role = role.to_s @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/rails_orchestrator/message.rb', line 5 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
5 6 7 |
# File 'lib/rails_orchestrator/message.rb', line 5 def role @role end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/rails_orchestrator/message.rb', line 16 def ==(other) other.is_a?(Message) && role == other.role && content == other.content end |
#to_h ⇒ Object
12 13 14 |
# File 'lib/rails_orchestrator/message.rb', line 12 def to_h { role: @role, content: @content } end |