BAT_Notifications 0.0.0 → 0.0.4

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: 22e5b75d4dc1f212ed6be86164f0e2490c8a6ba816003acaffc97cad0cc52853
4
- data.tar.gz: d5d8ebf0161746c08f73906c9dd1940d4c4f06855eb7d177b28036bd5eb414eb
3
+ metadata.gz: 0cf413e7951a8fc361e6d3aa460a5bfaaae177411fab9e633a32f44bfd411eb5
4
+ data.tar.gz: f4639bb3f5dfd3d621a0aaf335f6e22214f94b79bf4890120c61dc420e6b42bb
5
5
  SHA512:
6
- metadata.gz: 8a4fc4d8830cbd408ed88d2a981b13d3b87a361ad41a2fa362f1d6d12ea62e2448fbc5e2f437684210a0ae84dfffd699eb368bda47e382d0ee6012c4afddedab
7
- data.tar.gz: 6bec9f6eae2adcdeba367c5ab75529e7846b01d93262c22ed734dae74739b74f0334b1b47d97a78b0bac0cddf0c1999cc1ead2671ec2041f4367ffce059fb3cd
6
+ metadata.gz: 25b623519b99e38ee5f932629739d0bb8916567279dcf70ba380fc48762996b3517cd97f22a25d9f8ac762742ace4a4a498c40e1220ac19cb450f6c4d280cbca
7
+ data.tar.gz: ea4c4ebebfbea0cd4f62ced77cb53c812041faeec8f046948e4687f3957ad35df15561edb429fe276a7fb48c4f6eaa231b502718822cee7a0e25db7fb65919a4
@@ -1,29 +1,30 @@
1
- module AUser
2
- def self.sender
3
- return {
4
- "id" => "3",
5
- "email" => "bookatutorapp@gmail.com",
6
- "firstname" => "John",
7
- "lastname" => "Sender",
8
- "role" => "Student",
9
- "gender" => "Male",
10
- "has_profile" => "true",
11
- "location" => "Dublin"
12
- }
13
- end
14
-
15
- def self.receiver
16
- return {
17
- "id" => "3",
18
- "email" => "femi.abdul67@gmail.com",
19
- "firstname" => "John",
20
- "lastname" => "Receiver",
21
- "role" => "Tutor",
22
- "gender" => "Male",
23
- "has_profile" => "true",
24
- "location" => "Dublin"
25
- }
26
- end
27
-
28
-
1
+ module AUser
2
+ def self.sender
3
+ return {
4
+ "id" => "3",
5
+ "email" => "house16studio@gmail.com",
6
+ "firstname" => "John",
7
+ "lastname" => "Sender",
8
+ "role" => "Student",
9
+ "gender" => "Male",
10
+ "has_profile" => "true",
11
+ "location" => "Dublin"
12
+ }
13
+ end
14
+
15
+ def self.receiver
16
+ return {
17
+ "id" => "3",
18
+ "email" => "femi.abdul67@gmail.com",
19
+ "firstname" => "John",
20
+ "lastname" => "Receiver",
21
+ "role" => "Tutor",
22
+ "gender" => "Male",
23
+ "has_profile" => "true",
24
+ "location" => "Dublin"
25
+ }
26
+ end
27
+
28
+
29
+
29
30
  end
@@ -1,44 +1,44 @@
1
- require_relative 'Notification'
2
-
3
-
4
- module BasicNotificationDecorator
5
-
6
- def self.set_action(action)
7
- @action = action
8
- end
9
-
10
- def self.init_basic_decorator
11
- set_action("Basic Notification")
12
- @basicNotification = BasicNotification.new(@action, "Sender", "Receiver", "Message" )
13
- end
14
-
15
-
16
- def self.get_basic_notification_action
17
- init_basic_decorator
18
- return @basicNotification.get_action
19
- end
20
-
21
- def self.get_basic_notification_sender
22
- init_basic_decorator
23
- return @basicNotification.get_sender
24
- end
25
-
26
- def self.get_basic_notification_receiver
27
- init_basic_decorator
28
- return @basicNotification.get_receiver
29
- end
30
-
31
- def self.get_basic_notification_content
32
- init_basic_decorator
33
- return @basicNotification.get_content
34
- end
35
-
36
- def self.get_basic_notification_base
37
- init_basic_decorator
38
- return @basicNotification.get_notification_base
39
- end
40
-
41
-
42
-
43
- end
44
-
1
+ require_relative 'bat_notifications'
2
+
3
+
4
+ module BasicNotificationDecorator
5
+
6
+ def self.set_action(action)
7
+ @action = action
8
+ end
9
+
10
+ def self.init_basic_decorator
11
+ set_action("Basic Notification")
12
+ @basicNotification = BasicNotification.new(@action, "Sender", "Receiver", "Message" )
13
+ end
14
+
15
+
16
+ def self.get_basic_notification_action
17
+ init_basic_decorator
18
+ return @basicNotification.get_action
19
+ end
20
+
21
+ def self.get_basic_notification_sender
22
+ init_basic_decorator
23
+ return @basicNotification.get_sender
24
+ end
25
+
26
+ def self.get_basic_notification_receiver
27
+ init_basic_decorator
28
+ return @basicNotification.get_receiver
29
+ end
30
+
31
+ def self.get_basic_notification_content
32
+ init_basic_decorator
33
+ return @basicNotification.get_content
34
+ end
35
+
36
+ def self.get_basic_notification_base
37
+ init_basic_decorator
38
+ return @basicNotification.get_notification_base
39
+ end
40
+
41
+
42
+
43
+ end
44
+
@@ -1,66 +1,83 @@
1
- require_relative 'Notification'
2
- require_relative 'NotificationDb'
3
- require_relative "Content.rb"
4
-
5
- require "async"
6
-
7
-
8
- module BookingNotificationDecorator
9
-
10
- def self.set_action(action)
11
- @action = action
12
- end
13
-
14
-
15
- def self.set_content
16
- @content = Content.booking_content
17
- end
18
-
19
- def self.set_sender
20
- @sender = NotificationDb.get_sender
21
- end
22
-
23
- def self.set_receiver
24
- @receiver = NotificationDb.get_receiver
25
- end
26
-
27
-
28
- def self.init_booking_decorator
29
- set_action("Booking")
30
- set_content
31
- set_sender
32
- set_receiver
33
- @bookingNotification = BookingNotification.new( @action, @sender, @receiver, @content )
34
- end
35
-
36
- def self.get_booking_action
37
- init_booking_decorator
38
- return @bookingNotification.get_action
39
- end
40
-
41
- def self.get_booking_content
42
- init_booking_decorator
43
- content = @bookingNotification.get_content
44
- booking_location = content["location"]
45
- return true if booking_location
46
- end
47
-
48
- def self.get_booking_creator
49
- init_booking_decorator
50
- return @bookingNotification.get_sender["lastname"]
51
- end
52
-
53
- def self.get_user_booked
54
- init_booking_decorator
55
- return @bookingNotification.get_receiver["lastname"]
56
- end
57
-
58
- def self.send_notification
59
- init_booking_decorator
60
- return @bookingNotification.send_notification
61
- end
62
-
63
- end
64
-
65
-
66
-
1
+ require_relative 'bat_notifications'
2
+ require_relative 'NotificationDb'
3
+ require_relative "Content.rb"
4
+
5
+ require "async"
6
+
7
+
8
+ module BookingNotificationDecorator
9
+
10
+ def self.set_action(action)
11
+ @action = action
12
+ end
13
+
14
+
15
+ def self.set_content
16
+ @content = Content.booking_content
17
+ end
18
+
19
+ def self.set_sender
20
+ @sender = NotificationDb.get_sender
21
+ end
22
+
23
+ def self.set_receiver
24
+ @receiver = NotificationDb.get_receiver
25
+ end
26
+
27
+
28
+ def self.init_booking_decorator
29
+
30
+ set_content
31
+ set_sender
32
+ set_receiver
33
+ @notification = Notification.new(@sender, @receiver, @content)
34
+ @notification = BookingNotification.new(@notification)
35
+ end
36
+
37
+ def self.get_booking_action
38
+ init_booking_decorator
39
+ return @notification.get_action
40
+ end
41
+
42
+ def self.get_booking_content
43
+ init_booking_decorator
44
+ content = @notification.get_content
45
+ booking_location = content["location"]
46
+ return true if booking_location
47
+ end
48
+
49
+ def self.get_booking_creator
50
+ init_booking_decorator
51
+ return @notification.get_sender["lastname"]
52
+ end
53
+
54
+ def self.get_user_booked
55
+ init_booking_decorator
56
+ return @notification.get_receiver["lastname"]
57
+ end
58
+
59
+ def self.send_notification
60
+ init_booking_decorator
61
+ return @notification.send_notification_to_receiver
62
+ end
63
+
64
+ def self.get_user_booking_notification
65
+ init_booking_decorator
66
+ @notification = UserBookingNotification.new(@notification)
67
+ end
68
+
69
+ def self.get_user_booking_notification_subject
70
+ init_booking_decorator
71
+ @notification = UserBookingNotification.new(@notification)
72
+ return @notification.get_subject
73
+ end
74
+
75
+ def self.user_send_notification
76
+ init_booking_decorator
77
+ @notification = UserBookingNotification.new(@notification)
78
+ return @notification.send_notification_to_sender
79
+ end
80
+ end
81
+
82
+
83
+
@@ -1,37 +1,39 @@
1
- require_relative 'A_User'
2
-
3
- module Content
4
- def self.review_content
5
- return {
6
- "id" => "3",
7
- "reviewee" => AUser.receiver,
8
- "content" => "Very good tutor",
9
- "review_stars" => "4",
10
- "user_id" => AUser.sender[:id]
11
- }
12
- end
13
-
14
- def self.booking_content
15
- return {
16
- "id" => "4",
17
- "date" => DateTime.now,
18
- "location" => {
19
- "longitude" => "-6.243153391200242",
20
- "latitude" => "53.348738600000004"
21
- },
22
- "user_id" => AUser.sender[:id],
23
- "user_booked" => AUser.receiver
24
- }
25
- end
26
-
27
- def self.inbox_content
28
- return {
29
- "id" => "5",
30
- "message_to" => AUser.receiver,
31
- "message_from" => AUser.sender,
32
- "status" => "unread",
33
- "user_id" => AUser.sender[:id],
34
- "message_content" => "Hi, I will like to book you for a session."
35
- }
36
- end
1
+ require_relative 'A_User'
2
+ require 'date'
3
+
4
+ module Content
5
+ def self.review_content
6
+ return {
7
+ "id" => "3",
8
+ "reviewee" => AUser.receiver,
9
+ "content" => "Very good tutor",
10
+ "review_stars" => "4",
11
+ "user_id" => AUser.sender[:id]
12
+ }
13
+ end
14
+
15
+ def self.booking_content
16
+ return {
17
+ "id" => "4",
18
+ "date" => DateTime.now,
19
+ "location" => {
20
+ "longitude" => "-6.243153391200242",
21
+ "latitude" => "53.348738600000004"
22
+ },
23
+ "user_id" => AUser.sender[:id],
24
+ "user_booked" => AUser.receiver,
25
+ "hours_booked" => "4"
26
+ }
27
+ end
28
+
29
+ def self.inbox_content
30
+ return {
31
+ "id" => "5",
32
+ "message_to" => AUser.receiver,
33
+ "message_from" => AUser.sender,
34
+ "status" => "unread",
35
+ "user_id" => AUser.sender[:id],
36
+ "message_content" => "Hi, I will like to book you for a session."
37
+ }
38
+ end
37
39
  end
@@ -1,66 +1,66 @@
1
- require_relative 'Notification'
2
- require_relative 'NotificationDb'
3
- require_relative "Content.rb"
4
-
5
- require "async"
6
-
7
-
8
- module InboxNotificationDecorator
9
-
10
- def self.set_action(action)
11
- @action = action
12
- end
13
-
14
-
15
- def self.set_content
16
- @content = Content.inbox_content
17
- end
18
-
19
- def self.set_sender
20
- @sender = NotificationDb.get_sender
21
- end
22
-
23
- def self.set_receiver
24
- @receiver = NotificationDb.get_receiver
25
- end
26
-
27
-
28
- def self.init_inbox_decorator
29
- set_action("Inbox")
30
- set_content
31
- set_sender
32
- set_receiver
33
- @inboxNotification = InboxNotification.new( @action, @sender, @receiver, @content )
34
- end
35
-
36
- def self.get_inbox_action
37
- init_inbox_decorator
38
- return @inboxNotification.get_action
39
- end
40
-
41
- def self.get_inbox_content
42
- init_inbox_decorator
43
- content = @inboxNotification.get_content
44
- inbox_content = content["message_content"]
45
- return true if inbox_content
46
- end
47
-
48
- def self.get_inbox_sender
49
- init_inbox_decorator
50
- return @inboxNotification.get_sender["lastname"]
51
- end
52
-
53
- def self.get_inbox_receiver
54
- init_inbox_decorator
55
- return @inboxNotification.get_receiver["lastname"]
56
- end
57
-
58
- def self.send_notification
59
- init_inbox_decorator
60
- return @inboxNotification.send_notification
61
- end
62
-
63
- end
64
-
65
-
66
-
1
+ require_relative 'bat_notifications'
2
+ require_relative 'NotificationDb'
3
+ require_relative "Content.rb"
4
+
5
+ require "async"
6
+
7
+
8
+ module InboxNotificationDecorator
9
+
10
+ def self.set_action(action)
11
+ @action = action
12
+ end
13
+
14
+
15
+ def self.set_content
16
+ @content = Content.inbox_content
17
+ end
18
+
19
+ def self.set_sender
20
+ @sender = NotificationDb.get_sender
21
+ end
22
+
23
+ def self.set_receiver
24
+ @receiver = NotificationDb.get_receiver
25
+ end
26
+
27
+
28
+ def self.init_inbox_decorator
29
+ set_content
30
+ set_sender
31
+ set_receiver
32
+ @notification = Notification.new(@sender, @receiver, @content)
33
+ @notification = InboxNotification.new(@notification)
34
+ end
35
+
36
+ def self.get_inbox_action
37
+ init_inbox_decorator
38
+ return @notification.get_action
39
+ end
40
+
41
+ def self.get_inbox_content
42
+ init_inbox_decorator
43
+ content = @notification.get_content
44
+ inbox_content = content["message_content"]
45
+ return true if inbox_content
46
+ end
47
+
48
+ def self.get_inbox_sender
49
+ init_inbox_decorator
50
+ return @notification.get_sender["lastname"]
51
+ end
52
+
53
+ def self.get_inbox_receiver
54
+ init_inbox_decorator
55
+ return @notification.get_receiver["lastname"]
56
+ end
57
+
58
+ def self.send_notification
59
+ init_inbox_decorator
60
+ return @notification.send_notification_to_receiver
61
+ end
62
+
63
+ end
64
+
65
+
66
+