Implementation

Source Documentation

Constants

Attributes

Methods

Diagram.diagrammable()

def self.diagrammable()
return DIAGRAMMABLE
end

Gets DIAGRAMMABLE. Returns the Set reference.

Diagram.verify_diagrammable(inst = nil)

def self.verify_diagrammable(inst = nil)
return DIAGRAMMABLE.include?(inst.class())
end

Verifies an instance is diagrammable. Takes any instance, inst. Returns true in the case the argument is a diagrammable class's instance. Returns false otherwise.

Diagram.build(inst = nil)

def self.build(inst = nil)
case
when inst.instance_of?(Node)
return NodeDiagram.new(inst)
when inst.instance_of?(LinkedList)
return LLDiagram.new(inst)
when !self.verify_diagrammable(inst)
raise(ArgumentError, "#{inst} is not a diagrammable class instance.")
end
end

Builds an instance's diagram. Takes a diagrammable instance, inst. Returns the instance's Diagram kind instance.

Diagram.backward_arrow()

def self.backward_arrow()
return BACKWARD_ARROW
end

Gets BACKWARD_ARROW, a backward arrow symbol. Returns the String reference.

Diagram.forward_arrow()

def self.forward_arrow()
return FORWARD_ARROW
end

Gets FORWARD_ARROW, a forward arrow symbol. Returns the String reference.

Diagram.pipe()

def self.pipe()
return PIPE
end

Gets PIPE, a vertical line String. Returns the reference.

Diagram.space()

def self.space()
return SPACE
end

Gets SPACE, a space character. Returns the String reference.