Module: Slack::Web::Api::Endpoints::Views
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/views.rb
Instance Method Summary collapse
-
#views_open(options = {}) ⇒ Object
Open a view for a user.
-
#views_publish(options = {}) ⇒ Object
Publish a static view for a User.
-
#views_push(options = {}) ⇒ Object
Push a view onto the stack of a root view.
-
#views_update(options = {}) ⇒ Object
Update an existing view.
Instance Method Details
#views_open(options = {}) ⇒ Object
Open a view for a user.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/slack/web/api/endpoints/views.rb', line 18 def views_open( = {}) throw ArgumentError.new('Required arguments :trigger_id missing') if [:trigger_id].nil? throw ArgumentError.new('Required arguments :view missing') if [:view].nil? if .key?(:view) view = [:view] view = JSON.dump(view) unless view.is_a?(String) = .merge(view: view) end post('views.open', ) end |
#views_publish(options = {}) ⇒ Object
Publish a static view for a User.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/slack/web/api/endpoints/views.rb', line 40 def views_publish( = {}) throw ArgumentError.new('Required arguments :user_id missing') if [:user_id].nil? throw ArgumentError.new('Required arguments :view missing') if [:view].nil? if .key?(:view) view = [:view] view = JSON.dump(view) unless view.is_a?(String) = .merge(view: view) end post('views.publish', ) end |
#views_push(options = {}) ⇒ Object
Push a view onto the stack of a root view.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/slack/web/api/endpoints/views.rb', line 60 def views_push( = {}) throw ArgumentError.new('Required arguments :trigger_id missing') if [:trigger_id].nil? throw ArgumentError.new('Required arguments :view missing') if [:view].nil? if .key?(:view) view = [:view] view = JSON.dump(view) unless view.is_a?(String) = .merge(view: view) end post('views.push', ) end |
#views_update(options = {}) ⇒ Object
Update an existing view.
84 85 86 87 88 89 90 91 92 |
# File 'lib/slack/web/api/endpoints/views.rb', line 84 def views_update( = {}) throw ArgumentError.new('Required arguments :view missing') if [:view].nil? if .key?(:view) view = [:view] view = JSON.dump(view) unless view.is_a?(String) = .merge(view: view) end post('views.update', ) end |