Module: InboxNotificationDecorator

Defined in:
lib/InboxNotificationDecorator.rb

Class Method Summary collapse

Class Method Details

.get_inbox_actionObject



36
37
38
39
# File 'lib/InboxNotificationDecorator.rb', line 36

def self.get_inbox_action
    init_inbox_decorator
    return @notification.get_action
end

.get_inbox_contentObject



41
42
43
44
45
46
# File 'lib/InboxNotificationDecorator.rb', line 41

def self.get_inbox_content
    init_inbox_decorator
    content = @notification.get_content
    inbox_content = content["message_content"]
    return true if inbox_content
end

.get_inbox_receiverObject



53
54
55
56
# File 'lib/InboxNotificationDecorator.rb', line 53

def self.get_inbox_receiver
    init_inbox_decorator
    return @notification.get_receiver["lastname"]
end

.get_inbox_senderObject



48
49
50
51
# File 'lib/InboxNotificationDecorator.rb', line 48

def self.get_inbox_sender
    init_inbox_decorator
    return @notification.get_sender["lastname"]
end

.init_inbox_decoratorObject



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

def self.init_inbox_decorator
    set_content
    set_sender
    set_receiver
    @notification = Notification.new(@sender, @receiver, @content)
    @notification = InboxNotification.new(@notification)
end

.send_notificationObject



58
59
60
61
# File 'lib/InboxNotificationDecorator.rb', line 58

def self.send_notification
    init_inbox_decorator
    return @notification.send_notification_to_receiver
end

.set_action(action) ⇒ Object



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

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

.set_contentObject



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

def self.set_content
    @content = Content.inbox_content
end

.set_receiverObject



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

def self.set_receiver
    @receiver = NotificationDb.get_receiver
end

.set_senderObject



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

def self.set_sender
    @sender = NotificationDb.get_sender
end