line-bot-api 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec45ce0d0e53493faf3ef7ed5215ed6bc7180e3a
4
- data.tar.gz: 637d8bbbe31a5b94f5ea509f61ed5346203b7701
3
+ metadata.gz: ac17e583e3e7d618381475bac207da05c13d61bb
4
+ data.tar.gz: ba6468b9b1b35b43cd09223ad4c672bfaaaa257e
5
5
  SHA512:
6
- metadata.gz: becad379a9f770893247f831f47ed84709a23deaa62a855bb1b36e0c8a5f2c70855f7cc52e0c9de430b5921d1412d29ed4d16e63b5fe6ac3bbf6d98f4d86e4ad
7
- data.tar.gz: 6c169825a036d23fd6276bcdff694652ecef46f8d28cbeba05888d51a01b2793f1d82ac4dde8b12a1fb1a1fd59ad28452f8e0f3dd609301ab2435c1fce6cd8ee
6
+ metadata.gz: 02c2995896e031ef222f50ce07999aa167143d816b6af19ab5b0e741a94dfc2e98bff452c68cd87bbd05e97343a710b28c864f8e52ec382cef4a888e19639858
7
+ data.tar.gz: ac2f3c60778040cfa45b7ad3cdbdd6cbbc65ea817fdb456c124a628a62ca462fbcdc8a78d4b572b35a43ea23396df769cb58deb91db0641d7d6ee17e5714e494
data/README.md CHANGED
@@ -5,15 +5,15 @@
5
5
 
6
6
  Line::Bot::API - SDK of the LINE Messaging API for Ruby.
7
7
 
8
- ## About LINE Messaging API
8
+ ## About the LINE Messaging API
9
9
 
10
- Please refer to the official api documents for details.
10
+ See the official API reference documentation for more information.
11
11
 
12
12
  https://devdocs.line.me/
13
13
 
14
14
  ## Synopsis
15
15
 
16
- usage is:
16
+ Usage:
17
17
 
18
18
  ```ruby
19
19
  # app.rb
@@ -45,7 +45,7 @@ post '/callback' do
45
45
  type: 'text',
46
46
  text: event.message['text']
47
47
  }
48
- client.reply(event['replyToken'], message)
48
+ client.reply_message(event['replyToken'], message)
49
49
  when Line::Bot::Event::MessageType::Image, Line::Bot::Event::MessageType::Video
50
50
  response = client.get_message_content(event.message['id'])
51
51
  tf = Tempfile.open("content")
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.0.0"
18
+ VERSION = "1.1.0"
19
19
  end
20
20
  end
21
21
  end
@@ -59,7 +59,7 @@ module Line
59
59
  credentials.values.all?
60
60
  end
61
61
 
62
- # Push messages to line server and to users.
62
+ # Push messages to line server and to user.
63
63
  #
64
64
  # @param user_id [String] User's identifiers
65
65
  # @param messages [Hash or Array]
@@ -105,6 +105,30 @@ module Line
105
105
  request.post
106
106
  end
107
107
 
108
+ # Multicast messages to line server and to users.
109
+ #
110
+ # @param to [Array or String]
111
+ # @param messages [Hash or Array]
112
+ #
113
+ # @return [Net::HTTPResponse]
114
+ def multicast(to, messages)
115
+ raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
116
+
117
+ to = [to] if to.is_a?(String)
118
+ messages = [messages] if messages.is_a?(Hash)
119
+
120
+ request = Request.new do |config|
121
+ config.httpclient = httpclient
122
+ config.endpoint = endpoint
123
+ config.endpoint_path = '/message/multicast'
124
+ config.credentials = credentials
125
+ config.to = to
126
+ config.messages = messages
127
+ end
128
+
129
+ request.post
130
+ end
131
+
108
132
  def leave_group(group_id)
109
133
  raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
110
134
 
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["LINE Corporation"]
10
10
  spec.email = ["hirohisa.kawasaki@gmail.com"]
11
11
 
12
- spec.description = "Line::Bot::API - SDK of the LINE BOT API"
13
- spec.summary = spec.description
12
+ spec.description = "Line::Bot::API - SDK of the LINE Messaging API for Ruby"
13
+ spec.summary = "SDK of the LINE Messaging API"
14
14
  spec.homepage = "https://github.com/line/line-bot-sdk-ruby"
15
15
  spec.license = "Apache-2.0"
16
16
 
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.0.0
4
+ version: 1.1.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: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2017-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
- description: Line::Bot::API - SDK of the LINE BOT API
83
+ description: Line::Bot::API - SDK of the LINE Messaging API for Ruby
84
84
  email:
85
85
  - hirohisa.kawasaki@gmail.com
86
86
  executables: []
@@ -127,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.4.5
130
+ rubygems_version: 2.5.1
131
131
  signing_key:
132
132
  specification_version: 4
133
- summary: Line::Bot::API - SDK of the LINE BOT API
133
+ summary: SDK of the LINE Messaging API
134
134
  test_files: []