Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 6bdef25

Browse files
committed
Fix several ruby styling issues
1 parent 36abf88 commit 6bdef25

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

rest/voice/generate-twiml-record/twiml-record.5.x.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020

2121
get voice_gather do
2222
redirect voice_endpoint unless %w[1 2].include?(params['Digits'])
23-
if params['Digits'] == '1'
23+
case params['Digits']
24+
when '1'
2425
response = Twilio::TwiML::Response.new do |r|
2526
r.Dial '+13105551212'
2627
r.Say 'The call failed or the remote party hung up. Goodbye.'
2728
end
28-
elsif params['Digits'] == '2'
29+
when '2'
2930
response = Twilio::TwiML::Response.new do |r|
3031
r.Say 'Record your message after the tone.'
3132
r.Record maxLength: '30', action: voice_record, method: 'get'

security/signature_validation_tests/signature_validation_tests.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# rubocop:disable Metrics/MethodLength
2121
def test_url(method, url, params, valid)
2222
if method == 'GET'
23-
url += '?' + URI.encode_www_form(params)
23+
url += "?#{URI.encode_www_form(params)}"
2424
params = {}
2525
end
2626

video/rest/compositions/get-composition-media-file/get-composition-media-file.5.x.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
media_location = response.body['redirect_to']
2020
# For example, write the composition media to a local file
2121
open('myFile.mp4', 'wb') do |file|
22-
file << open(media_location).read
22+
file << File.open(media_location).read
2323
end

0 commit comments

Comments
 (0)