Module: SendNotification

Defined in:
lib/SendNotification.rb

Class Method Summary collapse

Class Method Details

.get_basic_notification_actionObject



49
50
51
52
# File 'lib/SendNotification.rb', line 49

def self.get_basic_notification_action
    init_basic_decorator
    return @basicNotification.get_action
end

.get_basic_notification_baseObject



69
70
71
72
# File 'lib/SendNotification.rb', line 69

def self.get_basic_notification_base
    init_basic_decorator
    return @basicNotification.get_notification_base
end

.get_basic_notification_messageObject



64
65
66
67
# File 'lib/SendNotification.rb', line 64

def self.get_basic_notification_message
    init_basic_decorator
    return @basicNotification.get_message
end

.get_basic_notification_receiverObject



59
60
61
62
# File 'lib/SendNotification.rb', line 59

def self.get_basic_notification_receiver
    init_basic_decorator
    return @basicNotification.get_receiver
end

.get_basic_notification_senderObject



54
55
56
57
# File 'lib/SendNotification.rb', line 54

def self.get_basic_notification_sender
    init_basic_decorator
    return @basicNotification.get_sender
end

.get_notification_baseObject



35
36
37
38
# File 'lib/SendNotification.rb', line 35

def self.get_notification_base
    @notificationBase = Notification.new
    return @notificationBase
end

.init_basic_decoratorObject



74
75
76
77
# File 'lib/SendNotification.rb', line 74

def self.init_basic_decorator
    set_base_and_action("Basic Notification")
    @basicNotification = BasicDecorator.new(@notificationBase, @action, "Sender", "Receiver", "Message" )
end

.sendAppNotificationObject



26
27
28
29
30
31
# File 'lib/SendNotification.rb', line 26

def self.sendAppNotification
    set_base_and_action("Message")
    @bookingsNotification = AppMessageDecorator.new(@notificationBase, @action, "Femi", "Lanre", "You have a message from BookATutor")
    puts @bookingsNotification.message
    puts @bookingsNotification.get_message
end

.sendBookingNotificationObject



5
6
7
8
9
10
# File 'lib/SendNotification.rb', line 5

def self.sendBookingNotification
    set_base_and_action("Booking")
    @bookingsNotification = BookingsDecorator.new(@notificationBase, @action, "Femi", "Lanre", "I have booked you for a Session")
    puts @bookingsNotification.message
    puts @bookingsNotification.get_message
end

.sendMessageNotificationObject



19
20
21
22
23
24
# File 'lib/SendNotification.rb', line 19

def self.sendMessageNotification
    set_base_and_action("Message")
    @bookingsNotification = InboxDecorator.new(@notificationBase, @action, "Femi", "Lanre", "I have sent you a message")
    puts @bookingsNotification.message
    puts @bookingsNotification.get_message
end

.sendReviewNotification(@sender, @receiver, @content) ⇒ Object



12
13
14
15
16
17
# File 'lib/SendNotification.rb', line 12

def self.sendReviewNotification(@sender, @receiver, @content)
    set_base_and_action("Review")
    @bookingsNotification = ReviewDecorator.new(@notificationBase, @action, @sender, @receiver, @content)
    puts @bookingsNotification.message
    puts @bookingsNotification.get_message
end

.set_action(action) ⇒ Object



40
41
42
# File 'lib/SendNotification.rb', line 40

def self.set_action(action)
    @action = action
end

.set_base_and_action(action) ⇒ Object



44
45
46
47
# File 'lib/SendNotification.rb', line 44

def self.set_base_and_action(action)
    get_notification_base
    set_action(action)
end