Class: Llmemory::LongTerm::FileBased::Item
- Inherits:
-
Object
- Object
- Llmemory::LongTerm::FileBased::Item
- Defined in:
- lib/llmemory/long_term/file_based/item.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#provenance ⇒ Object
readonly
Returns the value of attribute provenance.
-
#source_resource_id ⇒ Object
readonly
Returns the value of attribute source_resource_id.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(id:, user_id:, category:, content:, source_resource_id: nil, provenance: nil, created_at: nil) ⇒ Item
constructor
A new instance of Item.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, user_id:, category:, content:, source_resource_id: nil, provenance: nil, created_at: nil) ⇒ Item
Returns a new instance of Item.
9 10 11 12 13 14 15 16 17 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 9 def initialize(id:, user_id:, category:, content:, source_resource_id: nil, provenance: nil, created_at: nil) @id = id @user_id = user_id @category = category @content = content @source_resource_id = source_resource_id @provenance = provenance @created_at = created_at || Time.now end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def category @category end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def content @content end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def id @id end |
#provenance ⇒ Object (readonly)
Returns the value of attribute provenance.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def provenance @provenance end |
#source_resource_id ⇒ Object (readonly)
Returns the value of attribute source_resource_id.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def source_resource_id @source_resource_id end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
7 8 9 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 7 def user_id @user_id end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/llmemory/long_term/file_based/item.rb', line 19 def to_h { id: id, user_id: user_id, category: category, content: content, source_resource_id: source_resource_id, provenance: provenance, created_at: created_at.iso8601 } end |