Class: EventPart

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
lib/evently/event.rb

Class Method Summary collapse

Class Method Details

.serialize_and_initialize(obj) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/evently/event.rb', line 18

def self.serialize_and_initialize(obj)
  if obj.is_a?(Mongoid::Document)
    EventPart.new(content: { name: obj.name, class_name: obj.class.name, id: obj.id.to_s })
  else
    EventPart.new(content: obj)
  end
end