Interface

Class: DiagramFactoryInt. Source Documentation.

Constants

Attributes

instance undeclared

A DiagramFactory singleton instance.

inventory undeclared

The elements are Hashes containing diagrams. The keys are children instances, and the values are Sets. The value Set elements are particular kind diagrams.

Method Signatures

self.instance()

def self.instance()
end

Lazily initializes an instance. In the case the singleton already exists, gets the instance. Otherwise, instantiates and returns the instance. Returns the DiagramFactory singleton instance.

diagram(diagrammable = nil)

def diagram(diagrammable = nil)
end

Gets a diagrammable object's diagram. In the case none exist, assembles one. Takes a diagrammable object argument, diagrammable. Returns diagrammable's Diagram.

diagram_exists(diagrammable = nil)

def diagram_exists(diagrammable = nil)
end

Predicate. Verifies a diagrammable object's diagram was assembled. Takes a diagrammable object argument, diagrammable. Returns true in the case inventory contains an identical hash key. false otherwise.

k_diagram_exists(diagrammable = nil)

def k_diagram_exists(diagrammable = nil)
end

Predicate. Verifies a diagrammable's kind diagram exists. Takes a diagrammable object argument, diagrammable. Returns true in the case the diagrammable diagram kind exists. false otherwise.

inventory() private

def inventory()
end

Gets inventory. inventory is a hash Set. Each element is a Hash. The key is a diagrammable instance and the values are either a Set or a diagram instance. The values are Sets in the cases the particular diagrammable has kinds.

instance=() private

def instance=()
end

Sets instance. Returns the singleton instance.

inventory=() private

def inventory=()
end

Sets inventory. Initializes inventory an empty Set. Returns nil.

reassemble(diagrammable = nil) private

def reassemble(diagrammable = nil)
end

Reassembles a diagram. Takes a diagrammable object argument, diagrammable. Deletes the stale diagram, and adds the reassembly the diagrammable's inventory Set. Returns the Diagram assembly.

diagrams(diagrammable = nil) private

def diagrams(diagrammable = nil)
end

Gets a diagrammable's diagram Set. Takes a diagrammable argument object, diagrammable. Returns the diagrammable's diagram Set. Raises an ArgumentError in the case the argument's diagram was never assembled.

kind_diagram(diagrammable = nil) private

def kind_diagram(diagrammable = nil)
end

Gets diagrammable's kind diagram. Takes a diagrammable argument, diagrammable. Returns diagrammable's existing kind diagram. Raises an ArgumentError in the case the diagrammable has no corresponding diagram.

store_diagram(diagrammable = nil, diagram = nil) private

def store_diagram(diagrammable = nil, diagram = nil)
end

Stores a diagrammable's diagram. Takes a diagrammable argument, diagrammable, and a Diagram argument, diagram. In the case diagrammable is an inventory key, adds diagram the key's value or value Set. Otherwise, creates an appropriate inventory Hash. The key is diagrammable and the value is either a Set containing diagram, or diagram.

initialize() private

def initialize()
end

Initializes the singleton instance. Sets inventory.

DiagramFactoryInt.new() private, undefined