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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ff487539b4384e2c325a80f109073e9abcf7182
4
- data.tar.gz: fc9b3c3ad25ac10db2fb2aa5d92cdcdd54cd2085
3
+ metadata.gz: bacc569f18f3dbb680eb5a586cc5c629da742ea5
4
+ data.tar.gz: c3a94886a25da92b29c5765f1e8d5042e582db51
5
5
  SHA512:
6
- metadata.gz: a227dc053d1504b0defa1d6dc71f063fc946b0d9ce9c325467eef56bc896a8296f5ee41a49350f69be85fada574d031138f50edf9c64263be174ae0fd52f033b
7
- data.tar.gz: 3e4dcff37b45783236b0ec774dd5df85674385ca4c79ffafb9bed8927399826306b03f5e843fb6e2a44049a4377dc3d00693b310ea97e6ce5e74bd7dc83afa22
6
+ metadata.gz: 2a2fd710d001b8db5708258ef1744247bcb791e87111f4f11c083ef156bb6ed935a299fd72b151347031ad55f38a4a48a6165fea1113b88dabbbeb53c3e63f72
7
+ data.tar.gz: 3e746526009ce41a09c754e56a7590f91e66d445000319c79be1abc3073e27926fe33447cbfa0a6f41409ff43f2aa57edb1a0f80b59a50116d59ccefc221ff74
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.5.2"
18
+ VERSION = "1.6.0"
19
19
  end
20
20
  end
21
21
  end
@@ -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'].capitalize)
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
@@ -13,6 +13,7 @@
13
13
  # under the License.
14
14
 
15
15
  require 'line/bot/event/base'
16
+ require 'line/bot/event/account_link'
16
17
  require 'line/bot/event/beacon'
17
18
  require 'line/bot/event/follow'
18
19
  require 'line/bot/event/join'
@@ -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.5.2
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-02-19 00:00:00.000000000 Z
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