Class: ClaudeMemory::Domain::Provenance
- Inherits:
-
Object
- Object
- ClaudeMemory::Domain::Provenance
- Defined in:
- lib/claude_memory/domain/provenance.rb
Overview
Domain model representing provenance (evidence) for a fact
Instance Attribute Summary collapse
-
#content_item_id ⇒ Object
readonly
Returns the value of attribute content_item_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#fact_id ⇒ Object
readonly
Returns the value of attribute fact_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#quote ⇒ Object
readonly
Returns the value of attribute quote.
-
#strength ⇒ Object
readonly
Returns the value of attribute strength.
Instance Method Summary collapse
- #inferred? ⇒ Boolean
-
#initialize(attributes) ⇒ Provenance
constructor
A new instance of Provenance.
- #stated? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Provenance
Returns a new instance of Provenance.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/claude_memory/domain/provenance.rb', line 9 def initialize(attributes) @id = attributes[:id] @fact_id = attributes[:fact_id] @content_item_id = attributes[:content_item_id] @quote = attributes[:quote] @strength = attributes[:strength] || "stated" @created_at = attributes[:created_at] validate! freeze end |
Instance Attribute Details
#content_item_id ⇒ Object (readonly)
Returns the value of attribute content_item_id.
7 8 9 |
# File 'lib/claude_memory/domain/provenance.rb', line 7 def content_item_id @content_item_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/claude_memory/domain/provenance.rb', line 7 def created_at @created_at end |
#fact_id ⇒ Object (readonly)
Returns the value of attribute fact_id.
7 8 9 |
# File 'lib/claude_memory/domain/provenance.rb', line 7 def fact_id @fact_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/claude_memory/domain/provenance.rb', line 7 def id @id end |
#quote ⇒ Object (readonly)
Returns the value of attribute quote.
7 8 9 |
# File 'lib/claude_memory/domain/provenance.rb', line 7 def quote @quote end |
#strength ⇒ Object (readonly)
Returns the value of attribute strength.
7 8 9 |
# File 'lib/claude_memory/domain/provenance.rb', line 7 def strength @strength end |
Instance Method Details
#inferred? ⇒ Boolean
25 26 27 |
# File 'lib/claude_memory/domain/provenance.rb', line 25 def inferred? strength == "inferred" end |
#stated? ⇒ Boolean
21 22 23 |
# File 'lib/claude_memory/domain/provenance.rb', line 21 def stated? strength == "stated" end |
#to_h ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/claude_memory/domain/provenance.rb', line 29 def to_h { id: id, fact_id: fact_id, content_item_id: content_item_id, quote: quote, strength: strength, created_at: created_at } end |