module Brpoplpush::RedisScript::DSL::ClassMethods
Module ClassMethods
extends the base class with necessary methods
@author Mikael Henriksson <mikael@zoolutions.se>
Public Instance Methods
config()
click to toggle source
The current configuration (See: {.configure} on how to configure)
@return [RedisScript::Config] the gem configuration
# File lib/brpoplpush/redis_script/dsl.rb, line 54 def config @config ||= Config.new end
configure(options = {}) { |config| ... }
click to toggle source
Configure the gem
This is usually called once at startup of an application @param [Hash] options global gem options @option options [String, Pathname] :path @option options [Logger] :logger (default is Logger.new(STDOUT)) @yield control to the caller when given block
# File lib/brpoplpush/redis_script/dsl.rb, line 38 def configure(options = {}) if block_given? yield config else options.each do |key, val| config.send("#{key}=", val) end end end
execute(file_name, conn, keys: [], argv: [])
click to toggle source
# File lib/brpoplpush/redis_script/dsl.rb, line 25 def execute(file_name, conn, keys: [], argv: []) Brpoplpush::RedisScript::Client .new(config) .execute(file_name, conn, keys: keys, argv: argv) end