line-bot-api 1.7.0 → 1.8.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: 9680c4a827339588d6e293286f9ba26cc3ce8a97
4
- data.tar.gz: 2be978bf5c898cbdffd3910099cdf254f5645055
3
+ metadata.gz: 1e46e17ed076c1ef349b31a9454fe460558d3bfb
4
+ data.tar.gz: a2ac700cab74c4532e4946d61a4debfcffe9d6f8
5
5
  SHA512:
6
- metadata.gz: 450c23897326e6233d6926e8e2c1761d204d3bdbf1764877201684f0e71b030cfe58094412a624c6a233988565a8de5fa5ab017855706d873c5e728bc2ca244b
7
- data.tar.gz: 62da2fee4d2cab9d1b518ef80b28432b3cf3596e4429d5211acdbd6a4ce99edf67b5dab4693dbdff1030417e9f02b5af823f9f316ea87beec264276345463c49
6
+ metadata.gz: 9ce2b4e233ca0c9d477e4ed3b63a29dd7f9ce65d969d86da802866f19c912a4148eccb9e85d4b0365a459b2fc722522b5e2ba44f08794797c0bad25dda978949
7
+ data.tar.gz: 0ed61719314460020b602fa41784b301fcc25d4f18da65f3055aa5339d75aa67d7f173b04d5d53c68103471f2d695015f5aa13b1822c6a1832b398fef7efcf5e
@@ -12,6 +12,7 @@
12
12
  # License for the specific language governing permissions and limitations
13
13
  # under the License.
14
14
 
15
+ require 'line/bot/util'
15
16
  require 'line/bot/client'
16
17
  require 'line/bot/event'
17
18
  require 'line/bot/api/errors'
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.7.0"
18
+ VERSION = "1.8.0"
19
19
  end
20
20
  end
21
21
  end
@@ -466,9 +466,9 @@ module Line
466
466
 
467
467
  json['events'].map { |item|
468
468
  begin
469
- klass = Line::Bot::Event.const_get(camelize(item['type']))
469
+ klass = Line::Bot::Event.const_get(Line::Bot::Util.camelize(item['type']))
470
470
  klass.new(item)
471
- rescue NameError => e
471
+ rescue NameError
472
472
  Line::Bot::Event::Base.new(item)
473
473
  end
474
474
  }
@@ -510,11 +510,6 @@ 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
518
513
  end
519
514
  end
520
515
  end
@@ -23,3 +23,4 @@ require 'line/bot/event/postback'
23
23
  require 'line/bot/event/unfollow'
24
24
  require 'line/bot/event/member_joined'
25
25
  require 'line/bot/event/member_left'
26
+ require 'line/bot/event/things'
@@ -0,0 +1,37 @@
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
+ module ThingsType
19
+ Link = 'link'
20
+ Unlink = 'unlink'
21
+ Unsupport = 'unsupport'
22
+ end
23
+
24
+ class Things < Base
25
+ def type
26
+ Line::Bot::Event::ThingsType.const_get(Line::Bot::Util.camelize(@src['things']['type']))
27
+ rescue NameError
28
+ Line::Bot::Event::ThingsType::Unsupport
29
+ end
30
+
31
+ def device_id
32
+ @src['things']['deviceId']
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,24 @@
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 Util
18
+ # @return [String]
19
+ def self.camelize(string)
20
+ string.split(/_|(?=[A-Z])/).map(&:capitalize).join
21
+ end
22
+ end
23
+ end
24
+ 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.7.0
4
+ version: 1.8.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-03-05 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -95,9 +95,11 @@ files:
95
95
  - lib/line/bot/event/member_left.rb
96
96
  - lib/line/bot/event/message.rb
97
97
  - lib/line/bot/event/postback.rb
98
+ - lib/line/bot/event/things.rb
98
99
  - lib/line/bot/event/unfollow.rb
99
100
  - lib/line/bot/httpclient.rb
100
101
  - lib/line/bot/request.rb
102
+ - lib/line/bot/util.rb
101
103
  - line-bot-api.gemspec
102
104
  homepage: https://github.com/line/line-bot-sdk-ruby
103
105
  licenses: