module Blix

options:

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

Public Class Methods

filter_hash(filter,hash) click to toggle source

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

# 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) click to toggle source
# 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