Interface

A NodeDiagram interface's source documentation.

Constants

Attributes

node_string undeclared

The initializing Node's to_s() return.

data_text undeclared

The lower row's body text.

dl_padding undeclared

The data text's left padding.

dr_padding undeclared

The data text's right padding.

kind undeclared

The Node kind. Either lone, base, common, or pioneer.

Method Signatures

NodeDiagram.base_label()

def self.base_label()
end

Gets BASE_LABEL. Returns BASE_LABEL's String reference. Mutating BASE_LABEL's reference raises a FrozenError.

NodeDiagram.data_label()

def self.data_label()
end

Gets DATA_LABEL. Returns DATA_LABEL's String reference. Mutating DATA_LABEL's reference raises a FrozenError.

NodeDiagram.bl_length()

def self.bl_length()
end

Gets BL_LENGTH. Returns BL_LENGTH's String reference. Mutating BL_LENGTH's reference raises a FrozenError.

NodeDiagram.cp_length()

def self.cp_length()
end

Gets CP_LENGTH. Returns CP_LENGTH's Integer.

NodeDiagram.newline()

def self.newline()
end

Gets NEWLINE. Returns NEWLINE's String reference. Mutating the reference raises a FrozenError.

initialize(n = nil)

def initialize(n = nil)
end

Initializes a NodeDiagram. Takes any Node instance, n. Sets node_string the Node's to_s() return, data_text the Node's d() return, kind the Node's kind String, dl_padding a space multiplied, and dr_padding a space multiplied. Returns the initialized NodeDiagram.

node_string()

def node_string()
end

Gets node_string. Returns the String reference.

data_text()

def data_text()
end

Gets data_text. Returns the String reference.

dl_padding()

def dl_padding()
end

Gets dl_padding. Returns the String reference.

dr_padding()

def dr_padding()
end

Gets dr_padding. Returns the String reference.

kind()

def kind()
end

Gets kind. Returns the String reference.

lower_text(data = nil)

def lower_text(data = nil)
end

Concatenates the lower row text. Takes the initializing Node's data argument, data. Concatenates the data label, a space character, and the data's String conversion. Returns the concatenation.

upper_text()

def upper_text()
end

Concatenates the upper row's text. In the case the initializing Node's kind is base or lone, concatenates the base label, a space character, and node_string. Otherwise, returns node_string. Returns the concatenation or node_string.

dlp_quantity()

def dlp_quantity()
end

Computes the lower body's left padding quantity. In the case the initializing Node's kind is base or lone, the quantity is half the base-lone length less data_text's length. Otherwise, the quantity is half the common-pioneer length less data_text's length. Returns the Integer quantity.

drp_quantity()

def drp_quantity()
end

Computes the lower body's right padding quantity. The quantity is the half the available padding space. In the case the available space is odd, then the quantity is one greater than half the available padding space. The beginning available space quantity is 31 for bases and loners, and 26 for commoners and pioneers.

lower_body()

def lower_body()
end

Concatenates the lower row body's parts. Concatenates dl_padding, data_text, and dr_padding. Returns the concatenation.

row(body = nil)

def row(body = nil)
end

Forms a row. Takes a body String, the String between two pipes and spaces. Concatenates a pipe character, a space character, body, a space character, and a pipe character. Returns the concatenation.

kind_strategy(n = nil)

def kind_strategy(n = nil)
end

Discerns the initializing Node's kind. Takes an argument n, the initializing instance. Verifies the Node's state, and returns the corresponding kind String. The return is either 'base', 'lone', 'common', or 'pioneer'. Kind irrespective, the return reference is frozen.

form_lower()

def form_lower()
end

Forms the lower row. Argues row(body = nil) the lower body String. Returns the lower row String.

form_upper()

def form_upper()
end

Forms the upper row. Argues row(body = nil) the upper body text String. Returns the upper row String.

form()

def form()
end

Forms a diagram String. Concatenates the upper row formation, a newline character, and the lower row formation. Returns the concatenation.