Class: LocalBus

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/local_bus.rb,
lib/local_bus/bus.rb,
lib/local_bus/message.rb,
lib/local_bus/station.rb,
lib/local_bus/version.rb,
lib/local_bus/subscriber.rb,
lib/local_bus/publication.rb

Defined Under Namespace

Classes: Bus, Message, Publication, Station, Subscriber

Constant Summary collapse

VERSION =
"0.3.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#busObject (readonly)

Default Bus instance



22
23
24
# File 'lib/local_bus.rb', line 22

def bus
  @bus
end

#stationObject (readonly)

Default Station instance



26
27
28
# File 'lib/local_bus.rb', line 26

def station
  @station
end

Class Method Details

.publishObject

Publishes a message via the default Station



36
37
38
# File 'lib/local_bus.rb', line 36

def publish(...)
  instance.station.publish(...)
end

.publish_messageObject

Publishes a pre-built message via the default Station



43
44
45
# File 'lib/local_bus.rb', line 43

def publish_message(...)
  instance.station.publish_message(...)
end

.subscribeObject

Subscribe to a topic via the default Station



52
53
54
# File 'lib/local_bus.rb', line 52

def subscribe(...)
  instance.station.subscribe(...)
end

.unsubscribeObject

Unsubscribes a callable from a topic via the default Station



60
61
62
# File 'lib/local_bus.rb', line 60

def unsubscribe(...)
  instance.station.unsubscribe(...)
end

.unsubscribe_allObject

Unsubscribes all subscribers from a topic and removes the topic via the default Station



67
68
69
# File 'lib/local_bus.rb', line 67

def unsubscribe_all(...)
  instance.station.unsubscribe_all(...)
end