Module: Slack::Endpoint::Pins

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/pins.rb

Instance Method Summary collapse

Instance Method Details

#pins_add(options = {}) ⇒ Object

Pins an item to a channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Channel to pin the item in.

  • :file (Object)

    File to pin.

  • :file_comment (Object)

    File comment to pin.

  • :timestamp (Object)

    Timestamp of the message to pin.

See Also:



20
21
22
23
# File 'lib/slack/endpoint/pins.rb', line 20

def pins_add(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("pins.add", options)
end

#pins_list(options = {}) ⇒ Object

Lists items pinned to a channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Channel to get pinned items for.

See Also:



33
34
35
36
# File 'lib/slack/endpoint/pins.rb', line 33

def pins_list(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("pins.list", options)
end

#pins_remove(options = {}) ⇒ Object

Un-pins an item from a channel.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Channel where the item is pinned to.

  • :file (Object)

    File to un-pin.

  • :file_comment (Object)

    File comment to un-pin.

  • :timestamp (Object)

    Timestamp of the message to un-pin.

See Also:



52
53
54
55
# File 'lib/slack/endpoint/pins.rb', line 52

def pins_remove(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("pins.remove", options)
end