Class: System

Inherits:
Object show all
Defined in:
lib/tegu_gears/dynamics/noodle.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSystem

Returns a new instance of System.



43
44
45
# File 'lib/tegu_gears/dynamics/noodle.rb', line 43

def initialize
  @graph = GRATR::Digraph.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



51
52
53
# File 'lib/tegu_gears/dynamics/noodle.rb', line 51

def method_missing(sym, *args, &block)
  self.graph.send(sym, *args, &block)
end

Instance Attribute Details

#graphObject (readonly)

Returns the value of attribute graph.



42
43
44
# File 'lib/tegu_gears/dynamics/noodle.rb', line 42

def graph
  @graph
end

Class Method Details

.instanceObject



37
38
39
# File 'lib/tegu_gears/dynamics/noodle.rb', line 37

def instance
  @@instance ||= new
end

Instance Method Details

#add_edge(a, b, w = nil) ⇒ Object



47
48
49
# File 'lib/tegu_gears/dynamics/noodle.rb', line 47

def add_edge(a,b,w=nil)
  self.graph.add_edge!(a,b,w)
end