Class: HttpBaseline::NullBroadcaster

Inherits:
Object
  • Object
show all
Defined in:
lib/http_baseline/null_broadcaster.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ NullBroadcaster

Returns a new instance of NullBroadcaster.



4
5
6
# File 'lib/http_baseline/null_broadcaster.rb', line 4

def initialize(logger)
  @logger = logger
end

Instance Method Details

#notify_all_with(object, notification_type, *args) ⇒ Object



8
9
10
# File 'lib/http_baseline/null_broadcaster.rb', line 8

def notify_all_with(object, notification_type, *args)
  @logger.debug '[%s]: %s -> accepted :%s with %s' % [uname, object.class.name, notification_type, args.join(', ')]
end

#subscribe(other) ⇒ Object



16
17
18
# File 'lib/http_baseline/null_broadcaster.rb', line 16

def subscribe(other)
  (@null_storage ||= []) << other
end

#unameObject



12
13
14
# File 'lib/http_baseline/null_broadcaster.rb', line 12

def uname
  @uname ||= self.class.name.split('::').last
end