Module: Blix

Defined in:
lib/blix/rest/redis_cache.rb,
lib/blix/rest.rb,
lib/blix/utils/misc.rb,
lib/blix/rest/version.rb,
lib/blix/utils/redis_store.rb,
lib/blix/utils/yaml_config.rb

Overview

options:

:expire_secs           - how long store should save data.
:reset_expire_on_get   - start the expire timer again on read.

Defined Under Namespace

Modules: DatamapperExceptions, Rest Classes: RedisStore, YamlConfig

Class Method Summary collapse

Class Method Details

.filter_hash(filter, hash) ⇒ Object

filter the hash using the supplied filter

the filter is an array of keys that are permitted returns a hash containing only the permitted keys and values



16
17
18
19
# File 'lib/blix/utils/misc.rb', line 16

def self.filter_hash(filter,hash)
  hash = hash || {}
  hash.select {|key, value| filter.include?(key.to_sym) ||  filter.include?(key.to_s)}
end

.require_dir(path) ⇒ Object



5
6
7
8
# File 'lib/blix/utils/misc.rb', line 5

def self.require_dir(path)
   raise "invalid dir path:#{path}" unless File.directory?(path)
   Dir.glob("#{path}/*.rb").each {|file| require File.expand_path(file)[0..-4] }
end