Class: AuthRocket::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#event_typeObject (readonly)

Returns the value of attribute event_type.



13
14
15
# File 'lib/authrocket/event.rb', line 13

def event_type
  @event_type
end

Instance Method Details

#find_notification(nid) ⇒ Object



32
33
34
# File 'lib/authrocket/event.rb', line 32

def find_notification(nid)
  notifications.detect{|n| n.id == nid} || raise(RecordNotFound)
end

#notificationsObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/authrocket/event.rb', line 21

def notifications
  reload unless @attribs[:notifications]
  unless @stuffed_event
    @attribs[:notifications].each do |n|
      n.send :load, data: {event: self, event_id: id}
    end
    @stuffed_event = true
  end
  @attribs[:notifications]
end

#request_dataObject



16
17
18
# File 'lib/authrocket/event.rb', line 16

def request_data
  self[:request]
end