Class: RedisScripts::Script
- Inherits:
-
Struct
- Object
- Struct
- RedisScripts::Script
- Defined in:
- lib/redis_scripts.rb
Overview
Represents a script in a lua file under the load path.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#content ⇒ Object
The content of the script.
-
#sha ⇒ Object
The SHA1 of the content of the script.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
117 118 119 |
# File 'lib/redis_scripts.rb', line 117 def name @name end |
#path ⇒ Object
Returns the value of attribute path
117 118 119 |
# File 'lib/redis_scripts.rb', line 117 def path @path end |
Instance Method Details
#content ⇒ Object
The content of the script.
124 125 126 |
# File 'lib/redis_scripts.rb', line 124 def content @content = File.read(path) end |
#sha ⇒ Object
The SHA1 of the content of the script.
119 120 121 |
# File 'lib/redis_scripts.rb', line 119 def sha @sha ||= Digest::SHA1.file(path).to_s end |