Module: Twitter::Client::Notification

Included in:
Twitter::Client
Defined in:
lib/twitter/client/notification.rb

Overview

Defines methods related to notification

Instance Method Summary collapse

Instance Method Details

#disable_notifications(user, options = {}) ⇒ Twitter::User

Disables notifications for updates from the specified user to the authenticating user

Examples:

Disable device notifications for updates from @sferik

Twitter.disable_notifications("sferik")
Twitter.disable_notifications(7505382)  # Same as above

Parameters:

  • user (Integer, String)

    A Twitter user ID or screen name.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :include_entities (Boolean, String, Integer)

    Include Tweet Entities when set to true, 't' or 1.

Returns:

Raises:

See Also:

Rate Limited?:

  • No

Requires Authentication?:

  • Yes



41
42
43
44
45
# File 'lib/twitter/client/notification.rb', line 41

def disable_notifications(user, options={})
  options.merge_user!(user)
  user = post("/1/notifications/leave.json", options)
  Twitter::User.new(user)
end

#enable_notifications(user, options = {}) ⇒ Twitter::User

Enables device notifications for updates from the specified user to the authenticating user

Examples:

Enable device notifications for updates from @sferik

Twitter.enable_notifications("sferik")
Twitter.enable_notifications(7505382)  # Same as above

Parameters:

  • user (Integer, String)

    A Twitter user ID or screen name.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :include_entities (Boolean, String, Integer)

    Include Tweet Entities when set to true, 't' or 1.

Returns:

Raises:

See Also:

Rate Limited?:

  • No

Requires Authentication?:

  • Yes



22
23
24
25
26
# File 'lib/twitter/client/notification.rb', line 22

def enable_notifications(user, options={})
  options.merge_user!(user)
  user = post("/1/notifications/follow.json", options)
  Twitter::User.new(user)
end