Module: Slack::Web::Api::Endpoints::Canvases

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/canvases.rb

Instance Method Summary collapse

Instance Method Details

#canvases_create(options = {}) ⇒ Object

Create Canvas for a user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :document_content (Object)

    Structure describing the type and value of the content to create.

  • :title (string)

    Title of the newly created canvas.

See Also:



18
19
20
# File 'lib/slack/web/api/endpoints/canvases.rb', line 18

def canvases_create(options = {})
  post('canvases.create', options)
end

#canvases_delete(options = {}) ⇒ Object

Deletes a canvas.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :canvas_id (Object)

    Encoded ID of the canvas.

Raises:

  • (ArgumentError)

See Also:



29
30
31
32
# File 'lib/slack/web/api/endpoints/canvases.rb', line 29

def canvases_delete(options = {})
  raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
  post('canvases.delete', options)
end

#canvases_edit(options = {}) ⇒ Object

Update an existing canvas

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :canvas_id (Object)

    Encoded ID of the canvas.

  • :changes (array)

    List of changes to apply on the specified canvas.

Raises:

  • (ArgumentError)

See Also:



43
44
45
46
47
# File 'lib/slack/web/api/endpoints/canvases.rb', line 43

def canvases_edit(options = {})
  raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
  raise ArgumentError, 'Required arguments :changes missing' if options[:changes].nil?
  post('canvases.edit', options)
end