Module: BookingNotificationDecorator

Defined in:
lib/BookingNotificationDecorator.rb

Class Method Summary collapse

Class Method Details

.get_booking_actionObject



37
38
39
40
# File 'lib/BookingNotificationDecorator.rb', line 37

def self.get_booking_action
    init_booking_decorator
    return @notification.get_action
end

.get_booking_contentObject



42
43
44
45
46
47
# File 'lib/BookingNotificationDecorator.rb', line 42

def self.get_booking_content
    init_booking_decorator
    content = @notification.get_content
    booking_location = content["location"]
    return true if booking_location
end

.get_booking_creatorObject



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

def self.get_booking_creator
    init_booking_decorator
    return @notification.get_sender["lastname"]
end

.get_user_bookedObject



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

def self.get_user_booked
    init_booking_decorator
    return @notification.get_receiver["lastname"]
end

.get_user_booking_notificationObject



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

def self.get_user_booking_notification
    init_booking_decorator
    @notification = UserBookingNotification.new(@notification)
end

.get_user_booking_notification_subjectObject



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

def self.get_user_booking_notification_subject
    init_booking_decorator
    @notification = UserBookingNotification.new(@notification)
    return @notification.get_subject
end

.init_booking_decoratorObject



28
29
30
31
32
33
34
35
# File 'lib/BookingNotificationDecorator.rb', line 28

def self.init_booking_decorator

    set_content
    set_sender
    set_receiver
    @notification = Notification.new(@sender, @receiver, @content)
    @notification = BookingNotification.new(@notification)
end

.send_notificationObject



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

def self.send_notification
    init_booking_decorator
    return @notification.send_notification_to_receiver
end

.set_action(action) ⇒ Object



10
11
12
# File 'lib/BookingNotificationDecorator.rb', line 10

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

.set_contentObject



15
16
17
# File 'lib/BookingNotificationDecorator.rb', line 15

def self.set_content
    @content = Content.booking_content
end

.set_receiverObject



23
24
25
# File 'lib/BookingNotificationDecorator.rb', line 23

def self.set_receiver
    @receiver = NotificationDb.get_receiver
end

.set_senderObject



19
20
21
# File 'lib/BookingNotificationDecorator.rb', line 19

def self.set_sender
    @sender = NotificationDb.get_sender
end

.user_send_notificationObject



75
76
77
78
79
# File 'lib/BookingNotificationDecorator.rb', line 75

def self.user_send_notification
    init_booking_decorator
    @notification = UserBookingNotification.new(@notification)
    return @notification.send_notification_to_sender
end