zaikio-webhooks 0.0.11 → 0.1.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
  SHA256:
3
- metadata.gz: d872489dc81bf856f2fffc2739c3e985530b06800a973029e0854b3b84a5538f
4
- data.tar.gz: 1a15ca887a82dd696e0fbbccf44f0f40ff49a7e3ff392eb0f12608e3db9ffa4d
3
+ metadata.gz: '008db7504e26ef6d4024f8da17aec260c15fc296db2635bb662b97106f25200f'
4
+ data.tar.gz: c38d38522192bf514b623f0873ee845ce5d1b7d2a501491cf18e29caa1df08f0
5
5
  SHA512:
6
- metadata.gz: 82d3b14af857df3facfcad7afe8fcbcb270280ca8b5b4822c59179686638321221b7403313fc4f7c64e852e3e487dd651a1bcd6f53dc1e0aa6fd123c18b2871c
7
- data.tar.gz: f962d5b40432a34acd7680cd5582b546326003230e6e5e0af8a432b4e130863962909bed64579fa188b6d18d857aaae5b675ee52dd1a1e73816ed0d82e0c5400
6
+ metadata.gz: 7acb6eb1fd4c916108d3ef3f0c63ed4f00f97155d5803f3c8a296ac5232e37dc9b5dc9dcc133331316490547b4c52e11070c1ab5be10529c6cc000f29320806e
7
+ data.tar.gz: b1831de6855a06e8abd73137ce0149916eba4abc4c8ed90c7c3454694402c5577026247261ada9e75e219cb7c1216005dc1f6b18e3f9589a36dba98196b1ca30
@@ -4,28 +4,33 @@ module Zaikio
4
4
  module Webhooks
5
5
  class Event
6
6
  extend Forwardable
7
- attr_reader :data
8
7
 
9
- def_delegators :data, :id, :name, :version, :payload, :link, :client_name, :to_h
8
+ attr_reader :id, :name, :version, :payload, :link, :client_name, :data
9
+
10
+ def_delegators :data, :to_h
10
11
 
11
12
  def initialize(event_data)
12
- @data = OpenStruct.new(event_data)
13
+ event_data.each do |key, value|
14
+ instance_variable_set("@#{key}", value)
15
+ end
16
+
17
+ @data = event_data
13
18
  end
14
19
 
15
20
  def created_at
16
- DateTime.parse(data.timestamp)
21
+ DateTime.parse(data["timestamp"])
17
22
  end
18
23
 
19
24
  def received_at
20
- DateTime.parse(data.received_at)
25
+ DateTime.parse(data["received_at"])
21
26
  end
22
27
 
23
28
  def subject_id
24
- data.subject.split("/").last
29
+ data["subject"].split("/").last
25
30
  end
26
31
 
27
32
  def subject_type
28
- data.subject.split("/").first == "Org" ? "Organization" : "Person"
33
+ data["subject"].split("/").first == "Org" ? "Organization" : "Person"
29
34
  end
30
35
 
31
36
  def ==(other)
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module Webhooks
3
- VERSION = "0.0.11".freeze
3
+ VERSION = "0.1.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,75 +1,75 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaikio GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '6.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 6.0.2.2
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '6.0'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 6.0.2.2
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activejob
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '6.0'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
39
  version: 6.0.2.2
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '8'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '6.0'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
49
  version: 6.0.2.2
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '8'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: railties
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '6.0'
60
57
  - - ">="
61
58
  - !ruby/object:Gem::Version
62
59
  version: 6.0.2.2
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '8'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '6.0'
70
67
  - - ">="
71
68
  - !ruby/object:Gem::Version
72
69
  version: 6.0.2.2
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '8'
73
73
  description: Handle incoming Zaikio loom webhooks
74
74
  email:
75
75
  - js@crispymtn.com
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  requirements: []
115
- rubygems_version: 3.1.4
115
+ rubygems_version: 3.2.32
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Handle incoming Zaikio loom webhooks