Sha256: 85c511137eb98d161a3db91f9df7948f1a38cad48e05e3c4c1aacc31b0497d73

Contents?: true

Size: 334 Bytes

Versions: 8

Compression:

Stored size: 334 Bytes

Contents

module Sufia
  module WithEvents
    def stream
      Nest.new(self.class.name)[to_param]
    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

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.1.0 app/models/concerns/sufia/with_events.rb
sufia-7.0.0 app/models/concerns/sufia/with_events.rb
sufia-7.0.0.rc2 app/models/concerns/sufia/with_events.rb
sufia-7.0.0.rc1 app/models/concerns/sufia/with_events.rb
sufia-7.0.0.beta4 app/models/concerns/sufia/with_events.rb
sufia-7.0.0.beta3 app/models/concerns/sufia/with_events.rb
sufia-7.0.0.beta2 app/models/concerns/sufia/with_events.rb
sufia-7.0.0.beta1 app/models/concerns/sufia/with_events.rb