Class: ActiveModel::Pusher::RecordEventRecognizer
- Inherits:
-
Object
- Object
- ActiveModel::Pusher::RecordEventRecognizer
- Defined in:
- lib/active_model/pusher/record_event_recognizer.rb
Instance Method Summary collapse
- #event ⇒ Object
-
#initialize(record) ⇒ RecordEventRecognizer
constructor
A new instance of RecordEventRecognizer.
Constructor Details
#initialize(record) ⇒ RecordEventRecognizer
Returns a new instance of RecordEventRecognizer.
4 5 6 |
# File 'lib/active_model/pusher/record_event_recognizer.rb', line 4 def initialize(record) @record = record end |
Instance Method Details
#event ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/active_model/pusher/record_event_recognizer.rb', line 8 def event return nil unless can_be_recognized? if created? :created elsif updated? :updated elsif destroyed? :destroyed else nil end end |