Interface

A NodeObserver library's interface.

Constants

Attributes

observing undeclared

A subjects set.

changed undeclared

A changed subjects set.

Method Signatures

NodeObserverInt.instance()

def NodeObserverInt.instance()
end

Gets instance. Lazily initializes instance. Returns the singleton NodeObserver.

subject(n = nil)

def subject(n = nil)
end

Predicate. Verifies a Node is a subject. Takes an argument Node, n. Returns true in the case the argument is an observing element. Returns false otherwise.

changed_node(subject = nil)

def changed_node(subject = nil)
end

Predicate. Verifies a subject was changed. Takes a Node argument, subject. Returns true in the case the argument is a changed element. Returns false otherwise.

subject_changed(subject = nil)

def subject_changed(subject = nil)
end

Adds an existing subject the changed set. Takes a subject argument, subject. Receives the change, adds the subject the changed set, notifies the subject's subscribers, and deletes changed's element reference. Returns nil.

add(n = nil)

def add(n = nil)
end

Adds observing a subject. Takes an addend argument, n, and adds observing the argument. Returns nil.

remove(n = nil)

def remove(n = nil)
end

Removes a subject. Takes a Node argument, n, the removal. Removes the observing element. Returns nil.

observing() protected

def observing()
end

Gets observing. Returns the Set reference.

changed() protected

def changed()
end

Gets changed. Returns the Set reference.

add_changed(n = nil) protected

def add_changed(n = nil)
end

Adds changed a changed subject. Takes a changed subject Node, n. Adds changed the argument. Returns nil.

remove_changed(n = nil) protected

def remove_changed(n = nil)
end

Removes a changed subject. Takes a changed element argument, n. Deletes changed's element. Returns nil.

notify(n = nil) protected

def notify(n = nil)
end

Updates a subject's subscribers. Takes a changed subject argument, n. Updates the subscription, and removes changed's element. Returns nil.

observing=(s = nil) private

def observing=(s = nil)
end

Sets observing. Takes an empty Set, s. Assigns observing the Set. Returns the Set reference.

changed=(s = nil) private

def changed=(s = nil)
end

Sets changed. Takes an empty Set, s. Assigns changed the Set. Returns the Set reference.

receive_change(n = nil) private

def receive_change(n = nil)
end

Receives a Node's state change. Takes a changed subject argument, n. Adds changed the subject's reference, and notifies the subscribers. Returns nil.

initialize(subjects = Set[], changed_subjects = Set[]) private

def initialize(subjects = Set[], changed_subjects = Set[])
end

Initializes the singleton instance. Returns the NodeObserver singleton.

NodeObserverInt.instance=(singleton = nil) private

def NodeObserverInt.instance=(singleton = nil)
end

Sets instance. Takes a NodeObserver argument, singleton, the singleton instance. Sets instance the argument. Returns the argument NodeObserver.

NodeObserverInt.new() private, undeclared