Module: H2::On

Included in:
Client, Stream
Defined in:
lib/h2.rb

Instance Method Summary collapse

Instance Method Details

#on(event, *args, &block) ⇒ Object



88
89
90
91
92
93
# File 'lib/h2.rb', line 88

def on event, *args, &block
  @on ||= {}
  return @on[event]&.call(*args) unless block_given?
  return @on[event] = block if block_given?
  self
end