line-bot-api 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/line/bot/api/version.rb +1 -1
- data/lib/line/bot/client.rb +6 -1
- data/lib/line/bot/event.rb +1 -0
- data/lib/line/bot/event/account_link.rb +29 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bacc569f18f3dbb680eb5a586cc5c629da742ea5
|
4
|
+
data.tar.gz: c3a94886a25da92b29c5765f1e8d5042e582db51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a2fd710d001b8db5708258ef1744247bcb791e87111f4f11c083ef156bb6ed935a299fd72b151347031ad55f38a4a48a6165fea1113b88dabbbeb53c3e63f72
|
7
|
+
data.tar.gz: 3e746526009ce41a09c754e56a7590f91e66d445000319c79be1abc3073e27926fe33447cbfa0a6f41409ff43f2aa57edb1a0f80b59a50116d59ccefc221ff74
|
data/lib/line/bot/api/version.rb
CHANGED
data/lib/line/bot/client.rb
CHANGED
@@ -466,7 +466,7 @@ module Line
|
|
466
466
|
|
467
467
|
json['events'].map { |item|
|
468
468
|
begin
|
469
|
-
klass = Line::Bot::Event.const_get(item['type']
|
469
|
+
klass = Line::Bot::Event.const_get(camelize(item['type']))
|
470
470
|
klass.new(item)
|
471
471
|
rescue NameError => e
|
472
472
|
Line::Bot::Event::Base.new(item)
|
@@ -510,6 +510,11 @@ module Line
|
|
510
510
|
b.each_byte { |byte| res |= byte ^ l.shift }
|
511
511
|
res == 0
|
512
512
|
end
|
513
|
+
|
514
|
+
# @return [String]
|
515
|
+
def camelize(string)
|
516
|
+
string.split(/_|(?=[A-Z])/).map(&:capitalize).join
|
517
|
+
end
|
513
518
|
end
|
514
519
|
end
|
515
520
|
end
|
data/lib/line/bot/event.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Copyright 2016 LINE
|
2
|
+
#
|
3
|
+
# LINE Corporation licenses this file to you under the Apache License,
|
4
|
+
# version 2.0 (the "License"); you may not use this file except in compliance
|
5
|
+
# with the License. You may obtain a copy of the License at:
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
11
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
12
|
+
# License for the specific language governing permissions and limitations
|
13
|
+
# under the License.
|
14
|
+
|
15
|
+
module Line
|
16
|
+
module Bot
|
17
|
+
module Event
|
18
|
+
class AccountLink < Base
|
19
|
+
def result
|
20
|
+
@src['link']['result']
|
21
|
+
end
|
22
|
+
|
23
|
+
def nonce
|
24
|
+
@src['link']['nonce']
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: line-bot-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LINE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/line/bot/api/version.rb
|
86
86
|
- lib/line/bot/client.rb
|
87
87
|
- lib/line/bot/event.rb
|
88
|
+
- lib/line/bot/event/account_link.rb
|
88
89
|
- lib/line/bot/event/base.rb
|
89
90
|
- lib/line/bot/event/beacon.rb
|
90
91
|
- lib/line/bot/event/follow.rb
|