go_to_webinar 0.1.7 → 0.1.8

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: 2a2340879d6e5d4d802806db70c518c49c44ab08b4e694dec19f0ea310668f64
4
- data.tar.gz: 52ccd9e0df995de05c37a7fe3e597f7edfd013d87153f0de4d7d05c271b0defc
3
+ metadata.gz: 136217a3a77ef551798b55f54000561d146d6e8f17e2b6ffa1f6e3719d55a64b
4
+ data.tar.gz: b49329c4a3d2d7e5f1f2d81a884c8dc30d3f97aebf75167088d16bd860745f09
5
5
  SHA512:
6
- metadata.gz: 19aaf67e9201dbcd7901179663499e31f5ff37a0eba607801ecdb4209736930a18c91ec85ebbc2d2454c1512dc83ece6c597f64e48eafb1faf0a0025f21cc8b9
7
- data.tar.gz: 8e5469c9b6f0a1ea9420b1d5e661207d1c0f406fd5a2de326a41be4facec61a6c6b7f28ac3170642caef6e52bb1554d9502c90140a7bc6615378f5fc941ab791
6
+ metadata.gz: 3a2d38999de7195ea845e1ea94c53dd6f0911238b74bc62b40d2b2b5d728cfbfee36db1cccbb557bd63176db776251ca68d7a6cb8d45528a36d4fc3e39cf89b6
7
+ data.tar.gz: adbd478ee539827cdb1596e4b811da9b963e60d3e3933bbf21c5eaa55227d8362cb116cd5559e15ad8247b3818b31ca1646398b49633d7d11d9c76a76c48e20e
@@ -0,0 +1,51 @@
1
+ module GoToWebinar
2
+ class Attendee
3
+ def initialize(data)
4
+ @data = data
5
+ end
6
+
7
+ def registrant_key
8
+ @data['registrantKey'].to_s
9
+ end
10
+
11
+ def first_name
12
+ @data['firstName'].to_s
13
+ end
14
+
15
+ def last_name
16
+ @data['lastName'].to_s
17
+ end
18
+
19
+ def email
20
+ @data['email'].to_s
21
+ end
22
+
23
+ def attendance_time_in_seconds
24
+ @data['attendanceTimeInSeconds'].to_s
25
+ end
26
+
27
+ def session_key
28
+ @data['sessionKey'].to_s
29
+ end
30
+
31
+ def attendance
32
+ @data['attendance']
33
+ end
34
+
35
+ def join_time
36
+ attendance['joinTime'].to_datetime
37
+ end
38
+
39
+ def leave_time
40
+ attendance['leaveTime'].to_datetime
41
+ end
42
+
43
+ def self.all_for_session(webinar_key:, session_key:)
44
+ make(GoToWebinar.client.get("/organizers/:organizer_key:/webinars/#{webinar_key}/sessions/#{session_key}/attendees"))
45
+ end
46
+
47
+ def self.make(data)
48
+ data.map { |registrant| Attendee.new(registrant) }
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,65 @@
1
+ module GoToWebinar
2
+ class Session
3
+ def initialize(data)
4
+ @data = data
5
+ end
6
+
7
+ # startTime* string($date-time)
8
+ # The starting time of the webinar session
9
+ def start_time
10
+ @data['startTime']&.to_datetime
11
+ end
12
+
13
+ # registrantsAttended* integer($int32)
14
+ # The number of registrants who attended the webinar session
15
+ def registrants_attended
16
+ @data['registrantsAttended'].to_s
17
+ end
18
+
19
+ # webinarKey* integer($int64)
20
+ # The unique key of the webinar
21
+ def webinar_key
22
+ @data['webinarKey'].to_s
23
+ end
24
+
25
+ # webinarID* string
26
+ # The 9-digit webinar ID
27
+ def webinar_id
28
+ @data['webinarID'].to_s
29
+ end
30
+
31
+ # sessionKey* integer($int64)
32
+ # The unique key of the webinar session
33
+ def session_key
34
+ @data['sessionKey'].to_s
35
+ end
36
+
37
+ # endTime* string($date-time)
38
+ # The ending time of the webinar session
39
+ def end_time
40
+ @data['endTime']&.to_datetime
41
+ end
42
+
43
+ # Get session attendees
44
+ def attendees
45
+ Attendee.all_for_session(webinar_key: webinar_key, session_key: session_key)
46
+ end
47
+
48
+ def self.find(webinar_key:, session_key:)
49
+ data = make(GoToWebinar.client.get("/organizers/:organizer_key:/webinars/#{webinar_key}/sessions/#{session_key}"))
50
+ Session.new(data)
51
+ end
52
+
53
+ def self.for_webinar(webinar_key:)
54
+ make(GoToWebinar.client.get("/organizers/:organizer_key:/webinars/#{webinar_key}/sessions"))
55
+ end
56
+
57
+ def self.all
58
+ make(GoToWebinar.client.get("/organizers/:organizer_key:/sessions"))
59
+ end
60
+
61
+ def self.make(data)
62
+ data.map { |registrant| Session.new(registrant) }
63
+ end
64
+ end
65
+ end
@@ -1,3 +1,3 @@
1
1
  module GoToWebinar
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/go_to_webinar.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'rest-client'
2
2
  require 'json'
3
- require "go_to_webinar/version"
4
- require "go_to_webinar/configuration"
5
- require "go_to_webinar/client"
6
- require "go_to_webinar/webinar"
7
- require "go_to_webinar/registrant"
8
- require "go_to_webinar/attendee"
9
- require "go_to_webinar/session"
3
+ require 'go_to_webinar/version'
4
+ require 'go_to_webinar/attendee'
5
+ require 'go_to_webinar/client'
6
+ require 'go_to_webinar/configuration'
7
+ require 'go_to_webinar/registrant'
8
+ require 'go_to_webinar/session'
9
+ require 'go_to_webinar/webinar'
10
10
 
11
11
  module GoToWebinar
12
12
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_to_webinar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Jeremias da Silva
@@ -100,9 +100,11 @@ files:
100
100
  - bin/setup
101
101
  - go_to_webinar.gemspec
102
102
  - lib/go_to_webinar.rb
103
+ - lib/go_to_webinar/attendee.rb
103
104
  - lib/go_to_webinar/client.rb
104
105
  - lib/go_to_webinar/configuration.rb
105
106
  - lib/go_to_webinar/registrant.rb
107
+ - lib/go_to_webinar/session.rb
106
108
  - lib/go_to_webinar/version.rb
107
109
  - lib/go_to_webinar/webinar.rb
108
110
  homepage: https://github.com/RecruitiFi/go_to_webinar