Class: ClaudeMemory::Domain::Provenance

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_memory/domain/provenance.rb

Overview

Domain model representing provenance (evidence) for a fact

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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_atObject (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_idObject (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

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/claude_memory/domain/provenance.rb', line 7

def id
  @id
end

#quoteObject (readonly)

Returns the value of attribute quote.



7
8
9
# File 'lib/claude_memory/domain/provenance.rb', line 7

def quote
  @quote
end

#strengthObject (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

Returns:

  • (Boolean)


25
26
27
# File 'lib/claude_memory/domain/provenance.rb', line 25

def inferred?
  strength == "inferred"
end

#stated?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/claude_memory/domain/provenance.rb', line 21

def stated?
  strength == "stated"
end

#to_hObject



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