Class: Docit::SystemGraph::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/docit/system_graph/edge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, source:, target:, type:, confidence:, evidence:) ⇒ Edge

Returns a new instance of Edge.



8
9
10
11
12
13
14
15
# File 'lib/docit/system_graph/edge.rb', line 8

def initialize(id:, source:, target:, type:, confidence:, evidence:)
  @id = id.to_s
  @source = source.to_s
  @target = target.to_s
  @type = type.to_s
  @confidence = confidence.to_s
  @evidence = evidence.to_s
end

Instance Attribute Details

#confidenceObject (readonly)

Returns the value of attribute confidence.



6
7
8
# File 'lib/docit/system_graph/edge.rb', line 6

def confidence
  @confidence
end

#evidenceObject (readonly)

Returns the value of attribute evidence.



6
7
8
# File 'lib/docit/system_graph/edge.rb', line 6

def evidence
  @evidence
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/docit/system_graph/edge.rb', line 6

def id
  @id
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/docit/system_graph/edge.rb', line 6

def source
  @source
end

#targetObject (readonly)

Returns the value of attribute target.



6
7
8
# File 'lib/docit/system_graph/edge.rb', line 6

def target
  @target
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/docit/system_graph/edge.rb', line 6

def type
  @type
end

Instance Method Details

#to_hObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/docit/system_graph/edge.rb', line 17

def to_h
  {
    id: id,
    source: source,
    target: target,
    type: type,
    confidence: confidence,
    evidence: evidence
  }
end