Method: NSString#post_notification

Defined in:
lib/sugarcube-notifications/notifications.rb

#post_notification(object = nil, user_info = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sugarcube-notifications/notifications.rb', line 12

def post_notification(object=nil, =nil)
  if  and not .is_a? Hash
    raise TypeError("Invalid argument #{.class.name} sent to String.post_notification")
  end

  if 
    NSNotificationCenter.defaultCenter.postNotificationName(self, object:object, userInfo:)
  else
    NSNotificationCenter.defaultCenter.postNotificationName(self, object:object)
  end
end