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.8.5 lib/sugarcube/notifications.rb
sugarcube-0.8.4 lib/sugarcube/notifications.rb
sugarcube-0.8.3 lib/sugarcube/notifications.rb
sugarcube-0.8.2 lib/sugarcube/notifications.rb
sugarcube-0.8.1 lib/sugarcube/notifications.rb
sugarcube-0.8 lib/sugarcube/notifications.rb
sugarcube-0.7.9 lib/sugarcube/notifications.rb
sugarcube-0.7.7 lib/sugarcube/notifications.rb
sugarcube-0.7.6 lib/sugarcube/notifications.rb
sugarcube-0.7.4 lib/sugarcube/notifications.rb
sugarcube-0.7.3 lib/sugarcube/notifications.rb
sugarcube-0.7.2 lib/sugarcube/notifications.rb
sugarcube-0.7.1 lib/sugarcube/notifications.rb
sugarcube-0.7 lib/sugarcube/notifications.rb
sugarcube-0.6.1 lib/sugarcube/notifications.rb
sugarcube-0.6 lib/sugarcube/notifications.rb
sugarcube-0.5 lib/sugarcube/notifications.rb
sugarcube-0.4.2 lib/sugarcube/notifications.rb
sugarcube-0.4.1 lib/sugarcube/notifications.rb
sugarcube-0.4 lib/sugarcube/notifications.rb