Module: Croudia::Rest::Blocks

Included in:
Client
Defined in:
lib/croudia/rest/blocks.rb

Instance Method Summary collapse

Instance Method Details

#block(params = {}) ⇒ Croudia::Object::User

Blocks the specified user from following the authenticating user.

Parameters:

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

    A customized options.

Options Hash (params):

  • :screen_name (String)

    The screen name of the potentially blocked user.

  • :user_id (Integer)

    The ID of the potentially blocked user.

Returns:

See Also:



16
17
18
19
# File 'lib/croudia/rest/blocks.rb', line 16

def block(params = {})
  response = post('blocks/create.json', params)
  Croudia::Object::User.new(response)
end

#block_ids(params = {}) ⇒ Croudia::Object::IDs

Returns a collection of user ids that the authenticating user is blocking.

Parameters:

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

    A customized options.

Options Hash (params):

  • :cursor (Integer)

    The page cursor of collection.

Returns:

See Also:



50
51
52
53
# File 'lib/croudia/rest/blocks.rb', line 50

def block_ids(params = {})
  response = get('blocks/ids.json', params)
  Croudia::Object::IDs.new(response)
end

#blocks(params = {}) ⇒ Croudia::Object::List

Returns a collection of user objects that the authenticating user is blocking.

Parameters:

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

    A customized options.

Options Hash (params):

  • :cursor (Integer)

    The page cursor of collection.

Returns:

See Also:



39
40
41
42
# File 'lib/croudia/rest/blocks.rb', line 39

def blocks(params = {})
  response = get('blocks/list.json', params)
  Croudia::Object::List.new(response)
end

#unblock(params = {}) ⇒ Croudia::Object::User

Un-blocks the user specified in the ID parameter for the authenticating user.

Parameters:

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

    A customized options.

Options Hash (params):

  • :screen (String)

    The screen name of the potentially un-blocked user.

  • :user_id (Integer)

    The ID of the potentially un-blocked user.

Returns:

See Also:



28
29
30
31
# File 'lib/croudia/rest/blocks.rb', line 28

def unblock(params = {})
  response = post('blocks/destroy.json', params)
  Croudia::Object::User.new(response)
end