Module: Omnes::Subscriber::InstanceMethods

Defined in:
lib/omnes/subscriber.rb

Overview

Instance methods included in a Omnes::Subscriber

Instance Method Summary collapse

Instance Method Details

#subscribe_to(bus) ⇒ Omnes::Subscriber::Subscribers

Subscribes event handlers to a bus

Parameters:

Returns:

  • (Omnes::Subscriber::Subscribers)

Raises:

  • (Omnes::Subscriber::UnknownMethodSubscriptionAttemptError)

    when subscribing a method that doesn't exist

  • (Omnes::Subscriber::PrivateMethodSubscriptionAttemptError)

    when trying to subscribe a method that is private

  • (Omnes::Subscriber::DuplicateSubscriptionAttemptError)

    when trying to subscribe to the same event with the same method more than once



184
185
186
# File 'lib/omnes/subscriber.rb', line 184

def subscribe_to(bus)
  self.class.instance_variable_get(:@_state).public_send(:call, bus, self)
end