Class: Clusta::Geometry::Degree

Inherits:
Element
  • Object
show all
Defined in:
lib/clusta/geometry/degree.rb

Instance Attribute Summary

Attributes included from Schema

#extra_inputs

Instance Method Summary collapse

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

#+(other) ⇒ Object



23
24
25
26
# File 'lib/clusta/geometry/degree.rb', line 23

def +(other)
  raise DirectednessMismatchError.new if other.directed?
  self.class.new(vertex_label, self.degree + other.degree)
end

#directed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/clusta/geometry/degree.rb', line 11

def directed?
  false
end

#one(deg = 1) ⇒ Object



19
20
21
# File 'lib/clusta/geometry/degree.rb', line 19

def one deg=1
  self.class.new(vertex_label, deg)
end

#zeroObject



15
16
17
# File 'lib/clusta/geometry/degree.rb', line 15

def zero
  self.class.new(vertex_label, 0)
end