Class: RCrewAI::Knowledge::CsvSource
- Defined in:
- lib/rcrewai/knowledge/sources.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ CsvSource
constructor
A new instance of CsvSource.
- #read ⇒ Object
Constructor Details
#initialize(path) ⇒ CsvSource
Returns a new instance of CsvSource.
49 50 51 52 |
# File 'lib/rcrewai/knowledge/sources.rb', line 49 def initialize(path) super() @path = path end |
Instance Method Details
#read ⇒ Object
54 55 56 57 |
# File 'lib/rcrewai/knowledge/sources.rb', line 54 def read require 'csv' CSV.read(@path).map { |row| row.join(', ') }.join("\n") end |