From 830fcdff62a8e2c907973f3dd8ca4c2078f77c14 Mon Sep 17 00:00:00 2001 From: Fabien Chaynes Date: Mon, 17 Dec 2018 11:02:30 +0100 Subject: [PATCH] Change variable names. --- .../rest/direct_messages/welcome_messages.rb | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/twitter/rest/direct_messages/welcome_messages.rb b/lib/twitter/rest/direct_messages/welcome_messages.rb index 717d6f50c..22b44d447 100644 --- a/lib/twitter/rest/direct_messages/welcome_messages.rb +++ b/lib/twitter/rest/direct_messages/welcome_messages.rb @@ -22,8 +22,8 @@ def create_welcome_message(text, name = nil, options = {}) }, } json_options[:welcome_message][:name] = name if name - event = perform_request_with_object(:json_post, '/1.1/direct_messages/welcome_messages/new.json', json_options.merge!(options), Twitter::DirectMessages::WelcomeMessageWrapper) - event.welcome_message + welcome_message_wrapper = perform_request_with_object(:json_post, '/1.1/direct_messages/welcome_messages/new.json', json_options.merge!(options), Twitter::DirectMessages::WelcomeMessageWrapper) + welcome_message_wrapper.welcome_message end def destroy_welcome_message(*ids) @@ -39,21 +39,21 @@ def update_welcome_message(welcome_message_id, text, options = {}) text: text, }, } - event = perform_request_with_object(:json_put, '/1.1/direct_messages/welcome_messages/update.json', json_options.merge!(options), Twitter::DirectMessages::WelcomeMessageWrapper, params) - event.welcome_message + welcome_message_wrapper = perform_request_with_object(:json_put, '/1.1/direct_messages/welcome_messages/update.json', json_options.merge!(options), Twitter::DirectMessages::WelcomeMessageWrapper, params) + welcome_message_wrapper.welcome_message end def welcome_message(id, options = {}) options = options.dup options[:id] = id - event = perform_get_with_object('/1.1/direct_messages/welcome_messages/show.json', options, Twitter::DirectMessages::WelcomeMessageWrapper) - event.welcome_message + welcome_message_wrapper = perform_get_with_object('/1.1/direct_messages/welcome_messages/show.json', options, Twitter::DirectMessages::WelcomeMessageWrapper) + welcome_message_wrapper.welcome_message end def welcome_message_list(options = {}) limit = options.fetch(:count, 20) - events = perform_get_with_cursor('/1.1/direct_messages/welcome_messages/list.json', options.merge!(no_default_cursor: true, count: 50, limit: limit), :welcome_messages, Twitter::DirectMessages::WelcomeMessageWrapper) - events.collect(&:welcome_message) + welcome_message_wrappers = perform_get_with_cursor('/1.1/direct_messages/welcome_messages/list.json', options.merge!(no_default_cursor: true, count: 50, limit: limit), :welcome_messages, Twitter::DirectMessages::WelcomeMessageWrapper) + welcome_message_wrappers.collect(&:welcome_message) end # Welcome Message Rule @@ -64,8 +64,8 @@ def create_welcome_message_rule(welcome_message_id, options = {}) welcome_message_id: welcome_message_id, }, } - event = perform_request_with_object(:json_post, '/1.1/direct_messages/welcome_messages/rules/new.json', json_options.merge!(options), Twitter::DirectMessages::WelcomeMessageRuleWrapper) - event.welcome_message_rule + rule_wrapper = perform_request_with_object(:json_post, '/1.1/direct_messages/welcome_messages/rules/new.json', json_options.merge!(options), Twitter::DirectMessages::WelcomeMessageRuleWrapper) + rule_wrapper.welcome_message_rule end def destroy_welcome_message_rule(*ids) @@ -75,14 +75,14 @@ def destroy_welcome_message_rule(*ids) def welcome_message_rule(id, options = {}) options = options.dup options[:id] = id - event = perform_get_with_object('/1.1/direct_messages/welcome_messages/rules/show.json', options, Twitter::DirectMessages::WelcomeMessageRuleWrapper) - event.welcome_message_rule + rule_wrapper = perform_get_with_object('/1.1/direct_messages/welcome_messages/rules/show.json', options, Twitter::DirectMessages::WelcomeMessageRuleWrapper) + rule_wrapper.welcome_message_rule end def welcome_message_rule_list(options = {}) limit = options.fetch(:count, 20) - events = perform_get_with_cursor('/1.1/direct_messages/welcome_messages/rules/list.json', options.merge!(no_default_cursor: true, count: 50, limit: limit), :welcome_message_rules, Twitter::DirectMessages::WelcomeMessageRuleWrapper) - events.collect(&:welcome_message_rule) + rule_wrappers = perform_get_with_cursor('/1.1/direct_messages/welcome_messages/rules/list.json', options.merge!(no_default_cursor: true, count: 50, limit: limit), :welcome_message_rules, Twitter::DirectMessages::WelcomeMessageRuleWrapper) + rule_wrappers.collect(&:welcome_message_rule) end end end