Sha256: 1c254ddcfdf7976745f1f24436444d1033fdb3732ed0f872aae35fabe449ffd9

Contents?: true

Size: 381 Bytes

Versions: 8

Compression:

Stored size: 381 Bytes

Contents

module Sufia
  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

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.4.1 app/models/concerns/sufia/with_events.rb
sufia-7.4.0 app/models/concerns/sufia/with_events.rb
sufia-7.3.1 app/models/concerns/sufia/with_events.rb
sufia-7.3.0 app/models/concerns/sufia/with_events.rb
sufia-7.3.0.rc3 app/models/concerns/sufia/with_events.rb
sufia-7.3.0.rc2 app/models/concerns/sufia/with_events.rb
sufia-7.3.0.rc1 app/models/concerns/sufia/with_events.rb
sufia-7.2.0 app/models/concerns/sufia/with_events.rb