Class: Rave::Models::Event::WaveletParticipantsChanged

Inherits:
Rave::Models::Event show all
Defined in:
lib/models/event.rb

Constant Summary collapse

ADDED =

:nodoc:

'participantsAdded'
REMOVED =

:nodoc:

'participantsRemoved'

Constants inherited from Rave::Models::Event

BLIP_ID

Constants included from Rave::Mixins::ObjectFactory

Rave::Mixins::ObjectFactory::WILDCARD

Instance Attribute Summary

Attributes included from Rave::Mixins::ObjectFactory

#type

Instance Method Summary collapse

Methods inherited from Rave::Models::Event

#blip, #blip_id, #modified_by, #timestamp, #wavelet

Methods included from Rave::Mixins::ObjectFactory

included

Methods included from Rave::Mixins::TimeUtils

#time_from_json

Constructor Details

#initialize(options = {}) ⇒ WaveletParticipantsChanged

:nodoc:



87
88
89
90
91
92
# File 'lib/models/event.rb', line 87

def initialize(options = {}) # :nodoc:
  super(options)
  
  add_user_ids(@properties[ADDED]) if @properties[ADDED]
  add_user_ids(@properties[REMOVED]) if @properties[REMOVED]
end

Instance Method Details

#participants_addedObject

Array of participants added to the wavelet [Array of User]



95
96
97
# File 'lib/models/event.rb', line 95

def participants_added # :nodoc:
  @properties[ADDED].map { |id| @context.users[id] }
end

#participants_removedObject

Array of participants removed from the wavelet [Array of User].



100
101
102
# File 'lib/models/event.rb', line 100

def participants_removed # :nodoc:
  @properties[REMOVED].map { |id| @context.users[id] }
end