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, user_info=nil) if user_info and not user_info.is_a? Hash raise TypeError("Invalid argument #{user_info.class.name} sent to String.post_notification") end if user_info NSNotificationCenter.defaultCenter.postNotificationName(self, object:object, userInfo:user_info) else NSNotificationCenter.defaultCenter.postNotificationName(self, object:object) end end |