Sha256: 672ef63888bb4adab846ccc428ad045e6c31c01c28dd0eb164b8a8fee85bb31c

Contents?: true

Size: 864 Bytes

Versions: 6

Compression:

Stored size: 864 Bytes

Contents

require 'looksist/version'
require 'jsonpath'
require 'looksist/common'
require 'looksist/core'
require 'looksist/redis_service'
require 'looksist/hashed'
require 'looksist/safe_lru_cache'


module Looksist

  extend ActiveSupport::Concern

  include Core
  include Hashed

  class << self
    attr_accessor :lookup_store, :driver, :cache_buffer_size, :redis_service

    def configure
      yield self
      self.redis_service = Looksist::RedisService.instance do |lookup|
        lookup.client = self.lookup_store
        lookup.buffer_size = self.cache_buffer_size || 50000
      end
    end

    def bucket_dump(entity)
      keys = Looksist.lookup_store.keys("#{entity.pluralize}*")
      values = Looksist.redis_service.send("#{entity}_for", keys.collect{|i| i.split('/').last})
      (keys.collect {|i| i.split('/').last}).zip(values).to_h
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
looksist-0.2.3 lib/looksist.rb
looksist-0.2.2 lib/looksist.rb
looksist-0.2.1 lib/looksist.rb
looksist-0.2.0 lib/looksist.rb
looksist-0.1.9 lib/looksist.rb
looksist-0.1.8 lib/looksist.rb