Module: Nova::Starbound::DefaultBehavior::Eventable::InstanceMethods

Included in:
Nova::Starbound::DefaultBehavior
Defined in:
lib/nova/starbound/default_behavior/eventable.rb

Overview

Instance methods.

Instance Method Summary collapse

Instance Method Details

#attach_events(protocol) ⇒ void

This method returns an undefined value.

Attaches the specified events to the protocol.



63
64
65
66
67
68
69
70
71
# File 'lib/nova/starbound/default_behavior/eventable.rb', line 63

def attach_events(protocol)
  self.class.handles.each do |k, v|
    if v.is_a? Symbol
      protocol.on(k, &method(v))
    else
      protocol.on(k, &v)
    end
  end
end