Class: Rave::Models::Event::BlipContributorsChanged

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

Overview

Blip events

Constant Summary collapse

ADDED =

:nodoc:

'contributorsAdded'
REMOVED =

:nodoc:

'contributorsRemoved'

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 = {}) ⇒ BlipContributorsChanged

:nodoc:



146
147
148
149
150
151
# File 'lib/models/event.rb', line 146

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

#contributors_addedObject

Array of contributors added to the wavelet [Array of User].



154
155
156
# File 'lib/models/event.rb', line 154

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

#contributors_removedObject

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



159
160
161
# File 'lib/models/event.rb', line 159

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