Class: ClaudeMemory::Domain::Conflict

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

Overview

Domain model representing a conflict between two facts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Conflict

Returns a new instance of Conflict.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/claude_memory/domain/conflict.rb', line 10

def initialize(attributes)
  @id = attributes[:id]
  @fact_a_id = attributes[:fact_a_id]
  @fact_b_id = attributes[:fact_b_id]
  @status = attributes[:status] || "open"
  @notes = attributes[:notes]
  @detected_at = attributes[:detected_at]
  @resolved_at = attributes[:resolved_at]

  validate!
  freeze
end

Instance Attribute Details

#detected_atObject (readonly)

Returns the value of attribute detected_at.



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

def detected_at
  @detected_at
end

#fact_a_idObject (readonly)

Returns the value of attribute fact_a_id.



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

def fact_a_id
  @fact_a_id
end

#fact_b_idObject (readonly)

Returns the value of attribute fact_b_id.



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

def fact_b_id
  @fact_b_id
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#notesObject (readonly)

Returns the value of attribute notes.



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

def notes
  @notes
end

#resolved_atObject (readonly)

Returns the value of attribute resolved_at.



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

def resolved_at
  @resolved_at
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#open?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/claude_memory/domain/conflict.rb', line 23

def open?
  status == "open"
end

#resolved?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/claude_memory/domain/conflict.rb', line 27

def resolved?
  status == "resolved"
end

#to_hObject



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/claude_memory/domain/conflict.rb', line 31

def to_h
  {
    id: id,
    fact_a_id: fact_a_id,
    fact_b_id: fact_b_id,
    status: status,
    notes: notes,
    detected_at: detected_at,
    resolved_at: resolved_at
  }
end