Class: Llmemory::LongTerm::FileBased::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/llmemory/long_term/file_based/category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_id:, name:, content: "", updated_at: nil) ⇒ Category

Returns a new instance of Category.



9
10
11
12
13
14
# File 'lib/llmemory/long_term/file_based/category.rb', line 9

def initialize(user_id:, name:, content: "", updated_at: nil)
  @user_id = user_id
  @name = name
  @content = content
  @updated_at = updated_at || Time.now
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



7
8
9
# File 'lib/llmemory/long_term/file_based/category.rb', line 7

def content
  @content
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/llmemory/long_term/file_based/category.rb', line 7

def name
  @name
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



7
8
9
# File 'lib/llmemory/long_term/file_based/category.rb', line 7

def updated_at
  @updated_at
end

#user_idObject (readonly)

Returns the value of attribute user_id.



7
8
9
# File 'lib/llmemory/long_term/file_based/category.rb', line 7

def user_id
  @user_id
end

Instance Method Details

#to_hObject



16
17
18
# File 'lib/llmemory/long_term/file_based/category.rb', line 16

def to_h
  { user_id: user_id, name: name, content: content, updated_at: updated_at.iso8601 }
end