Class: EventFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/models/event.rb

Class Method Summary collapse

Class Method Details

.build(attrs) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/models/event.rb', line 13

def self.build(attrs)
  Event.new(attrs[:id]).tap do |event|
    event.name = attrs[:name]
    event.user = attrs[:user]
    event.time = attrs[:time]
    event.params = attrs[:params]
  end
end