Class: Clusta::Geometry::DirectedEdge

Inherits:
Edge show all
Defined in:
lib/clusta/geometry/directed/edge.rb

Instance Attribute Summary

Attributes included from Schema

#extra_inputs

Instance Method Summary collapse

Methods inherited from Edge

#degree_of, #degrees, #joins?, #labels_string, #reversed, #weighted?

Methods inherited from Element

inherited

Methods included from Serialization::TSV

#extra_inputs=, #extra_outputs, included, #process_args, #suffix, #to_flat, #to_tsv_component

Methods included from Serialization::JSON

included, #non_key_field_data, #process_args, #to_flat, #to_hash

Methods included from Serialization

included, #initialize, #process_args, #stream_name

Methods included from Schema

#extra_outputs, #fields, included, #keys, #non_key_fields

Instance Method Details

#directed?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/clusta/geometry/directed/edge.rb', line 8

def directed?
  true
end

#neighborObject



20
21
22
# File 'lib/clusta/geometry/directed/edge.rb', line 20

def neighbor
  DirectedNeighbor.new(target_label, weight)
end

#source_degreeObject



12
13
14
# File 'lib/clusta/geometry/directed/edge.rb', line 12

def source_degree
  DirectedDegree.new(source_label, 0, 1)
end

#target_degreeObject



16
17
18
# File 'lib/clusta/geometry/directed/edge.rb', line 16

def target_degree
  DirectedDegree.new(target_label, 1, 0)
end