Sha256: 8afdb04ceabbdbf40c0d389613b8dcb5462ffcfe7390dede830c66062bd960b3

Contents?: true

Size: 450 Bytes

Versions: 27

Compression:

Stored size: 450 Bytes

Contents

class NSString

  def post_notification(object=nil, user_info=nil)
    if user_info and not Hash === user_info
      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

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
sugarcube-0.3.2 lib/sugarcube/notifications.rb
sugarcube-0.3.1 lib/sugarcube/notifications.rb
sugarcube-0.3.0 lib/sugarcube/notifications.rb
sugarcube-0.2.5 lib/sugarcube/notifications.rb
sugarcube-0.2.3 lib/sugarcube/notifications.rb
sugarcube-0.2.2 lib/sugarcube/notifications.rb
sugarcube-0.2.1 lib/sugarcube/notifications.rb