Sha256: 3c0cfd939d20ab50236a7ce39837bb7d6bc06131b8e36ea419d298e688fcc4a9

Contents?: true

Size: 381 Bytes

Versions: 22

Compression:

Stored size: 381 Bytes

Contents

module Hyrax
  module WithEvents
    def stream
      Nest.new(event_class)[to_param]
    end

    def event_class
      self.class.name
    end

    def event_store
      RedisEventStore
    end

    def events(size = -1)
      event_store.for(stream[:event]).fetch(size)
    end

    def log_event(event_id)
      event_store.for(stream[:event]).push(event_id)
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.3 app/models/concerns/hyrax/with_events.rb
hyrax-1.1.0 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.2 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.1 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.rc3 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.rc2 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.rc1 app/models/concerns/hyrax/with_events.rb
hyrax-1.0.5 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.beta5 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.beta4 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.beta3 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.beta2 app/models/concerns/hyrax/with_events.rb
hyrax-2.0.0.beta1 app/models/concerns/hyrax/with_events.rb
hyrax-1.0.4 app/models/concerns/hyrax/with_events.rb
hyrax-1.0.3 app/models/concerns/hyrax/with_events.rb
hyrax-1.0.2 app/models/concerns/hyrax/with_events.rb
hyrax-1.0.1 app/models/concerns/hyrax/with_events.rb
hyrax-1.0.0.rc2 app/models/concerns/hyrax/with_events.rb