Skip to content

Commit

Permalink
Change variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienChaynes authored and sferik committed Feb 12, 2020
1 parent 528b012 commit 830fcdf
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/twitter/rest/direct_messages/welcome_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 830fcdf

Please sign in to comment.