Skip to content

Commit 21361da

Browse files
committed
multi-line block
1 parent 01b4c0a commit 21361da

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

lib/line/bot/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,14 @@ def delete(endpoint_path)
483483
def parse_events_from(request_body)
484484
json = JSON.parse(request_body)
485485

486-
json['events'].map { |item|
486+
json['events'].map do |item|
487487
begin
488488
klass = Line::Bot::Event.const_get(Line::Bot::Util.camelize(item['type']))
489489
klass.new(item)
490490
rescue NameError
491491
Line::Bot::Event::Base.new(item)
492492
end
493-
}
493+
end
494494
end
495495

496496
# Validate signature

spec/line/bot/link_token_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
WebMock.allow_net_connect!
1212

1313
describe Line::Bot::Client do
14-
let(:client) {
14+
let(:client) do
1515
dummy_config = {
1616
channel_token: 'access token',
1717
}
1818
Line::Bot::Client.new do |config|
1919
config.channel_token = dummy_config[:channel_token]
2020
end
21-
}
21+
end
2222

2323
it 'issues a link token' do
2424
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/bot/user/{user_id}/linkToken'

spec/line/bot/rich_menu_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
WebMock.allow_net_connect!
4343

4444
describe Line::Bot::Client do
45-
let(:client) {
45+
let(:client) do
4646
dummy_config = {
4747
channel_token: 'access token',
4848
}
4949
Line::Bot::Client.new do |config|
5050
config.channel_token = dummy_config[:channel_token]
5151
end
52-
}
52+
end
5353

5454
it 'gets a list of rich menus' do
5555
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/bot/richmenu/list'
@@ -164,9 +164,9 @@
164164
it 'uploads and attaches an image to a rich menu' do
165165
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/bot/richmenu/1234567/content'
166166

167-
stub_request(:post, uri_template).to_return(body: '{}', status: 200).with { |request|
167+
stub_request(:post, uri_template).to_return(body: '{}', status: 200).with do |request|
168168
expect(request.headers["Content-Type"]).to eq('image/png')
169-
}
169+
end
170170

171171
File.open(RICH_MENU_IMAGE_FILE_PATH) do |image_file|
172172
client.create_rich_menu_image('1234567', image_file)
@@ -179,10 +179,10 @@
179179
it "uploads invalid extension's file" do
180180
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/bot/richmenu/1234567/content'
181181
stub_request(:post, uri_template).to_return(body: '{}', status: 200)
182-
expect {
182+
expect do
183183
File.open(RICH_MENU_INVALID_FILE_EXTENSION_PATH) do |file|
184184
client.create_rich_menu_image('1234567', file)
185185
end
186-
}.to raise_error(ArgumentError)
186+
end.to raise_error(ArgumentError)
187187
end
188188
end

0 commit comments

Comments
 (0)