Interface

A NodeSubscription library interface. Class: NodeSubscriptionInt.

Constants

Attributes

instance, undeclared

A singleton instance.

feeds, undeclared

All subscription feeds. Its elements are Hashes. The keys are Node references, and their values are Sets containing corresponding subscribers.

Method Signatures

NodeSubscriptionInt.instance()

def NodeSubscriptionInt.instance()
end

Lazily initializes a singleton instance, or gets the singleton instance. Returns the NodeSubscription singleton instance.

publisher(p = nil)

def publisher(p = nil)
end

Predicate. Verifies a Node is a feed publisher. Takes a publishable object argument, p. Returns true in the case p is a feeds key. false otherwise.

update_subscribers(publisher = nil)

def update_subscribers(publisher = nil)
end

Updates a publisher's subscribers. Takes a changed Node publisher argument, publisher. Updates publisher's subscribers. In the case publisher is not a feeds key, raises an ArgumentError. Returns nil.

add_publisher(p = nil)

def add_publisher(p = nil)
end

Adds a Node publisher. Takes a Node argument, p. Creates a subscription feed. The feed's key is p, and the feed Set is empty.

add_subscriber(p = nil, s = nil)

def add_subscriber(p = nil, s = nil)
end

Adds a subscriber a feed. Takes a Node argument, p, and a subscribable instance, s. Adds the subscriber, s, the publisher p's feed. In the case p is not a feed publisher, or s is not a subscribable object, raises an ArgumentError.

feeds() protected

def feeds()
end

Gets feeds. Returns the Set reference.

feed(p = nil) protected

def feed(p = nil)
end

Gets a publisher's feed. Takes a Node argument, p. Finds the publisher p's feed, and returns its Set reference. In the case p is not a feeds element Hash key, raises an ArgumentError.

feeds=(s = Set[]) private

def feeds=(s = Set[])
end

Sets feeds. The parameter s defaults an empty Set. feeds calls once, in the singleton instance's initialization, and sets feeds the empty Set.

kind_factory(s = nil) private

def kind_factory(s = nil)
end

Gets a subscriber's factory identifier. Takes an argument subscriber, s. Discerns s's factory identifier, and returns the identifier.

initialize() private

def initialize()
end

Initializes the singleton instance.

NodeSubscriptionInt.instance=(s = nil) private

def NodeSubscriptionInt.instance=(s = nil)
end

Sets the singleton instance. Takes a NodeSubscription instance argument, s. Sets instance the instance. Returns the argument NodeSubscription.

NodeSubscriptionInt.new() private, undeclared