Class: Pair::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/pair/notification.rb,
lib/pair/notification/dispatcher.rb,
lib/pair/notification/growl_logger.rb,
lib/pair/notification/custom_errors.rb,
lib/pair/notification/linux_dispatcher.rb,
lib/pair/notification/o_s_x_dispatcher.rb

Defined Under Namespace

Classes: Dispatcher, GNTPError, LinuxDispatcher, OSXDispatcher

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dispatchObject (readonly)

Returns the value of attribute dispatch.



8
9
10
# File 'lib/pair/notification.rb', line 8

def dispatch
  @dispatch
end

Class Method Details

.dispatcher(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pair/notification.rb', line 11

def dispatcher(options = {})
  if Pair::OS.os_x?
    dispatch = OSXDispatcher.new(options)
  else
    dispatch = LinuxDispatcher.new(options)
  end

  if block_given?
    yield dispatch
  else
    dispatch
  end
end