Module: Hyrax::WithEvents
- Included in:
- FileSetBehavior, FileSetPresenter, Resource, WorkBehavior
- Defined in:
- app/models/concerns/hyrax/with_events.rb
Overview
A mixin module intended to provide an interface into creating the paper trail of activity on the target model of the mixin.
Instance Method Summary collapse
Instance Method Details
#event_class ⇒ String
13 14 15 |
# File 'app/models/concerns/hyrax/with_events.rb', line 13 def event_class model_name.name end |
#events(size = -1)) ⇒ Object
21 22 23 |
# File 'app/models/concerns/hyrax/with_events.rb', line 21 def events(size = -1) event_stream.fetch(size) end |
#log_event(event_id) ⇒ Object
25 26 27 |
# File 'app/models/concerns/hyrax/with_events.rb', line 25 def log_event(event_id) event_stream.push(event_id) end |
#stream ⇒ Object
8 9 10 |
# File 'app/models/concerns/hyrax/with_events.rb', line 8 def stream Nest.new(event_class)[to_param] end |