Sha256: d4957f854bc7ecb7839bae6ea6d2c68aa95d9650c2d83367d907379c5a49eab7

Contents?: true

Size: 844 Bytes

Versions: 18

Compression:

Stored size: 844 Bytes

Contents

diff --git a/lib/slack/web/api/endpoints/dialog.rb b/lib/slack/web/api/endpoints/dialog.rb
index 01f9dfd..d017adf 100644
--- a/lib/slack/web/api/endpoints/dialog.rb
+++ b/lib/slack/web/api/endpoints/dialog.rb
@@ -17,6 +17,12 @@ module Slack
           def dialog_open(options = {})
             throw ArgumentError.new('Required arguments :dialog missing') if options[:dialog].nil?
             throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
+            # dialog must be passed as an encoded JSON string
+            if options.key?(:dialog)
+              dialog = options[:dialog]
+              dialog = JSON.dump(dialog) unless dialog.is_a?(String)
+              options = options.merge(dialog: dialog)
+            end
             post('dialog.open', options)
           end
         end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
slack-ruby-client-1.1.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-1.0.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.17.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.16.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.15.1 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.15.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.6 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.5 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.4 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.3 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.2 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.1 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.14.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.13.1 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.13.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.12.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.11.1 lib/slack/web/api/patches/dialog.1.open-json-support.patch
slack-ruby-client-0.11.0 lib/slack/web/api/patches/dialog.1.open-json-support.patch