Class: RubyAgent::Response
- Inherits:
-
Object
- Object
- RubyAgent::Response
- Defined in:
- lib/ruby_agent/response.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #add_event(event) ⇒ Object
- #append_text(content) ⇒ Object
- #final_text ⇒ Object
-
#initialize(text: "", events: []) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(text: "", events: []) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/ruby_agent/response.rb', line 5 def initialize(text: "", events: []) @text = text @events = events end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
3 4 5 |
# File 'lib/ruby_agent/response.rb', line 3 def events @events end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/ruby_agent/response.rb', line 3 def text @text end |
Instance Method Details
#add_event(event) ⇒ Object
14 15 16 17 |
# File 'lib/ruby_agent/response.rb', line 14 def add_event(event) @events << event self end |
#append_text(content) ⇒ Object
19 20 21 22 |
# File 'lib/ruby_agent/response.rb', line 19 def append_text(content) @text += content self end |
#final_text ⇒ Object
10 11 12 |
# File 'lib/ruby_agent/response.rb', line 10 def final_text @text end |