def self.diagrammable()return DIAGRAMMABLEend
Gets DIAGRAMMABLE
. Returns the Set
reference.
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.
def self.build(inst = nil)​casewhen 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.
def self.backward_arrow()return BACKWARD_ARROWend
Gets BACKWARD_ARROW
, a backward arrow symbol. Returns the String
reference.
def self.forward_arrow()return FORWARD_ARROWend
Gets FORWARD_ARROW
, a forward arrow symbol. Returns the String
reference.
def self.pipe()return PIPEend
Gets PIPE
, a vertical line String
. Returns the reference.
def self.space()return SPACEend
Gets SPACE
, a space character. Returns the String
reference.