Module: Brpoplpush::RedisScript::DSL::ClassMethods
- Defined in:
- lib/brpoplpush/redis_script/dsl.rb
Overview
Module ClassMethods extends the base class with necessary methods
Instance Method Summary collapse
-
#config ⇒ RedisScript::Config
The current configuration (See: #configure on how to configure).
-
#configure(options = {}) { ... } ⇒ Object
Configure the gem.
- #execute(file_name, conn, keys: [], argv: []) ⇒ Object
Instance Method Details
#config ⇒ RedisScript::Config
The current configuration (See: #configure on how to configure)
54 55 56 |
# File 'lib/brpoplpush/redis_script/dsl.rb', line 54 def config @config ||= Config.new end |
#configure(options = {}) { ... } ⇒ Object
Configure the gem
This is usually called once at startup of an application
38 39 40 41 42 43 44 45 46 |
# File 'lib/brpoplpush/redis_script/dsl.rb', line 38 def configure( = {}) if block_given? yield config else .each do |key, val| config.send("#{key}=", val) end end end |
#execute(file_name, conn, keys: [], argv: []) ⇒ Object
25 26 27 28 29 |
# 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 |