oksky-chat-api 0.1.2 → 0.1.3

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: f529de9ffd8cda1abbc63d41fbcb34901d5aade8
4
- data.tar.gz: d6d2c5d961dc5a11fe937b8862e84d203487f41c
3
+ metadata.gz: 8665394fca4ddf8574dc33525b3a5263155a2575
4
+ data.tar.gz: 9c3089ed53919ec7f8ca170dddc1b4dfc3f6411d
5
5
  SHA512:
6
- metadata.gz: 8ce138fc5ee4b0be8511ec0e433f7048e917e95f0c932b55fdc6456e59a26803310835161e454480f232f1e2f61cd2b6a3d184962da21bca634816c96f8f6561
7
- data.tar.gz: 3d993fa08c0818ae5e4aade60fcefaf7ff15bb62a4c3e4c22b277d8f04a51d0ce19fa6442ffd3b2c6c5e14b5eb7483b02b2659a4c18150238f93cd6a2a897f9c
6
+ metadata.gz: a36b75c28839ddf938cba617a7d4b9c7ed02ad9a25a2067d283cb729421a50b12cfcb9ced54b5b92d40d2ba2573ab9b86f75c545253b1e59665c84c5b6e8f153
7
+ data.tar.gz: ba759dc99ef29792948be245dec4023fe1b202f96f6ccfedd7277118db39a931386e88867057d15f44e4e4ceb6cc629add52f064f2d449e124aec13bc4151cd4
@@ -1,7 +1,7 @@
1
1
  module Oksky
2
2
  module Chat
3
3
  module API
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
@@ -15,17 +15,41 @@ module Oksky
15
15
  # @param messages [Hash or Array]
16
16
  #
17
17
  # @return [Net::HTTPResponse]
18
+ #
19
+ # Example:
20
+ # md = {"content":"test0001","kind":"text","settings":{},"status":"","info":"","tags":[]}
21
+ # room_id = 3200
22
+ # messages_data = {
23
+ # "data":{
24
+ # "type":"messages",
25
+ # "attributes":md, # {"content"=>nil, "kind"=>"text", "settings"=>{}}
26
+ # "relationships":{
27
+ # "room":{
28
+ # "data":{
29
+ # "type":"rooms",
30
+ # "id": "#{room_id}"
31
+ # }
32
+ # }
33
+ # }
34
+ # }
35
+ # }
36
+ #
37
+ # message_client = Oksky::Chat::Client::Message.new { |config|
38
+ # config.access_token = "hogehoge"
39
+ # config.endpoint = "https://hogehoge.ok-sky.com/rapi/v1"
40
+ # }
41
+ # message_client.push_message(messages_data)
18
42
  def push_message(messages)
19
43
  raise Oksky::Chat::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
20
44
 
21
- messages = [messages] if messages.is_a?(Hash)
45
+ # messages = [messages] if messages.is_a?(Hash)
22
46
 
23
47
  request = Request.new do |config|
24
48
  config.httpclient = httpclient
25
49
  config.endpoint = endpoint
26
50
  config.endpoint_path = '/messages'
27
51
  config.credentials = credentials
28
- config.messages = messages
52
+ config.payload = messages
29
53
  end
30
54
 
31
55
  request.post
@@ -69,4 +93,4 @@ module Oksky
69
93
  end
70
94
  end
71
95
  end
72
- end
96
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oksky-chat-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SOLAIRO, INC.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-20 00:00:00.000000000 Z
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.6.14
145
+ rubygems_version: 2.6.11
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: ''