Class: Foobara::Agent::Context

Inherits:
Model
  • Object
show all
Defined in:
foobara-agent-0.0.21/src/foobara/agent/types/context.rb

Constant Summary

Constants inherited from Model

Model::ALLOWED_OPTIONS

Instance Attribute Summary

Attributes inherited from Model

#mutable, #skip_validations

Instance Method Summary collapse

Methods inherited from Model

#==, abstract, abstract?, attribute_names, #attributes, #attributes_with_delegates, #cast_attribute, #cast_attribute!, closest_namespace_module, description, domain, domain_name, #eql?, foobara_model_name, foobara_name, full_model_name, #hash, #initialize, install!, organization_name, possible_errors, #read_attribute, #read_attribute!, reset_all, subclass, #to_h, #to_json, #valid?, valid_attribute_name?, #validate!, validate_attribute_name!, #validation_errors, #write_attribute, #write_attribute!, #write_attributes, #write_attributes!

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Constructor Details

This class inherits a constructor from Foobara::Model

Instance Method Details

#set_new_goal(goal) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'foobara-agent-0.0.21/src/foobara/agent/types/context.rb', line 14

def set_new_goal(goal)
  self.previous_goals ||= []

  if current_goal
    previous_goals << current_goal
  end

  self.current_goal = Goal.new(text: goal)
end