Class: RubyAgent::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_agent/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#eventsObject (readonly)

Returns the value of attribute events.



3
4
5
# File 'lib/ruby_agent/response.rb', line 3

def events
  @events
end

#textObject (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_textObject



10
11
12
# File 'lib/ruby_agent/response.rb', line 10

def final_text
  @text
end