module EntityStore::Config

Attributes

cache_event_subscribers[RW]
feed_store[RW]

Stores

logger[RW]

Logger can be assigned

store[RW]

Stores

type_loader[RW]

Allows config to pass in a lambda or Proc to use as the type loader in place of the default. Original use case was migration of entity classes to new module namespace when extracting to a shared library

Public Class Methods

connect_timeout() click to toggle source
# File lib/entity_store/config.rb, line 48
def connect_timeout
  (ENV['ENTITY_STORE_CONNECT_TIMEOUT'] || '2').to_i
end
event_subscribers() click to toggle source
# File lib/entity_store/config.rb, line 26
def event_subscribers
  @_event_subscribers ||=[]
end
load_type(type_name) click to toggle source
# File lib/entity_store/config.rb, line 40
def load_type(type_name)
  if EntityStore::Config.type_loader
    EntityStore::Config.type_loader.call(type_name)
  else
    type_name.split('::').inject(Object) {|obj, name| obj.const_get(name) }
  end
end
setup() { |self| ... } click to toggle source
# File lib/entity_store/config.rb, line 18
def setup
  yield self

  raise StandardError.new("store not assigned") unless store
  store.open
  feed_store.open if feed_store
end
snapshot_threshold() click to toggle source

Public - indicates the version increment that is used to decided whether a snapshot of an entity should be created when it's saved

# File lib/entity_store/config.rb, line 32
def snapshot_threshold
  @_snapshot_threshold ||= 10
end
snapshot_threshold=(value) click to toggle source
# File lib/entity_store/config.rb, line 36
def snapshot_threshold=(value)
  @_snapshot_threshold = value
end