kamigo 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 2963e399e5536542922dd653e6527800889669fa6f8fb302f0b8d37bd2436c10
4
- data.tar.gz: ee45fef50df98a2829ecd5bb2f686835a9f688224de3f6fb3cd19fc85484472c
3
+ metadata.gz: db0d9d2daf788b28c09ddbb828dc6b43341a52a815d8f8dd7155e074885fd4a5
4
+ data.tar.gz: 4da9e45da277363d2d0cb34872e6a29eadf525fce23ca50aafacc2aa10de4b62
5
5
  SHA512:
6
- metadata.gz: 65729c55dc9c99092acff484f33c4e2db483ead417923b526a2a551ebaebfec6aba77d08925f79aeb8efc534fd80d28841a112abc5d35fdc084a2d398f8dd929
7
- data.tar.gz: 28971a710fb8d62645ad3ab483fb6afc10481b75cecc9341c53b3e4bfa4ae61800ab6bd4c73da84b3e3b9604cd0667f7d842b80e585a171829bbe9d5daef54a8
6
+ metadata.gz: bff6137ca7f6179fe409f699df103269e08209125d74e60edced0db4949143c1d1242a4878cfcf9aac571967b21573c76388cd12520bf7bb03dd8f242c791d5c
7
+ data.tar.gz: f8163f00f03c9a3d41fc000e155b8365cf3db90b15245c4d4fec68dd966481d2eb6a981309fa70d25775b75b678ca123718256da6147dd03bc8fdabf8e423e8d
@@ -18,6 +18,7 @@ class LineController < ApplicationController
18
18
  def process_event(event)
19
19
  http_method, path, request_params = language_understanding(event.message)
20
20
  encoded_path = URI.encode(path)
21
+ request_params = event.platform_params.merge(request_params)
21
22
  output = reserve_route(encoded_path, http_method: http_method, request_params: request_params, format: :line)
22
23
  responser = Kamigo::EventResponsers::LineEventResponser.new
23
24
  response = responser.response_event(event, output)
@@ -15,7 +15,6 @@ module Kamigo
15
15
  payload = JSON.parse(event.to_json, symbolize_names: true)[:src]
16
16
  line_event = Kamigo::Events::LineEvent.new
17
17
  line_event.payload = payload
18
- line_event.platform_type = 'line'
19
18
  line_event.reply_token = event['replyToken']
20
19
  line_event.source_type = payload.dig(:source, :type)
21
20
  line_event.source_group_id = payload.dig(:source, :groupId) || payload.dig(:source, :roomId) || payload.dig(:source, :userId)
@@ -8,6 +8,15 @@ module Kamigo
8
8
  attr_accessor :source_group_id
9
9
  attr_accessor :source_user_id
10
10
  attr_accessor :payload
11
+
12
+ def platform_params
13
+ {
14
+ platform_type: platform_type,
15
+ source_type: source_type,
16
+ source_group_id: source_group_id,
17
+ source_user_id: source_user_id
18
+ }
19
+ end
11
20
  end
12
21
  end
13
22
  end
@@ -2,6 +2,10 @@ module Kamigo
2
2
  module Events
3
3
  class LineEvent < BasicEvent
4
4
  attr_accessor :reply_token
5
+
6
+ def initialize
7
+ self.platform_type = 'line'
8
+ end
5
9
  end
6
10
  end
7
11
  end
@@ -1,3 +1,3 @@
1
1
  module Kamigo
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamigo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - etrex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-22 00:00:00.000000000 Z
11
+ date: 2019-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails