Class: System
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Class Method Summary collapse
Instance Method Summary collapse
- #add_edge(a, b, w = nil) ⇒ Object
-
#initialize ⇒ System
constructor
A new instance of System.
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ System
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
#graph ⇒ Object (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
.instance ⇒ Object
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 |