Class: Llmemory::LongTerm::FileBased::Category
- Inherits:
-
Object
- Object
- Llmemory::LongTerm::FileBased::Category
- Defined in:
- lib/llmemory/long_term/file_based/category.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(user_id:, name:, content: "", updated_at: nil) ⇒ Category
constructor
A new instance of Category.
- #to_h ⇒ Object
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
#content ⇒ Object (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 |
#name ⇒ Object (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_at ⇒ Object (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_id ⇒ Object (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_h ⇒ Object
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 |