Method: Slack::Web::Api::Endpoints::Views#views_open

Defined in:
lib/slack/web/api/endpoints/views.rb

#views_open(options = {}) ⇒ Object

Open a view for a user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :trigger_id (Object)

    Exchange a trigger to post to the user.

  • :view (Object)

    A view payload. This must be a JSON-encoded string.

See Also:



18
19
20
21
22
23
24
25
26
27
# File 'lib/slack/web/api/endpoints/views.rb', line 18

def views_open(options = {})
  throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
  throw ArgumentError.new('Required arguments :view missing') if options[:view].nil?
  if options.key?(:view)
    view = options[:view]
    view = JSON.dump(view) unless view.is_a?(String)
    options = options.merge(view: view)
  end
  post('views.open', options)
end