Skip to content

Commit 46ec548

Browse files
committed
Improve code example in README and examples
Now it uses do/end style of block for a long block. It follows standard coding convention of Ruby. See: https://github.com/rubocop-hq/ruby-style-guide#single-line-blocks
1 parent 6580e77 commit 46ec548

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ post '/callback' do
3636
end
3737

3838
events = client.parse_events_from(body)
39-
events.each { |event|
39+
events.each do |event|
4040
case event
4141
when Line::Bot::Event::Message
4242
case event.type
@@ -52,7 +52,7 @@ post '/callback' do
5252
tf.write(response.body)
5353
end
5454
end
55-
}
55+
end
5656

5757
"OK"
5858
end

examples/echobot/app.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def client
1818

1919
events = client.parse_events_from(body)
2020

21-
events.each { |event|
21+
events.each do |event|
2222
case event
2323
when Line::Bot::Event::Message
2424
case event.type
@@ -30,7 +30,7 @@ def client
3030
client.reply_message(event['replyToken'], message)
3131
end
3232
end
33-
}
33+
end
3434

3535
"OK"
3636
end

0 commit comments

Comments
 (0)