Class: RedisScripts::Script

Inherits:
Struct
  • Object
show all
Defined in:
lib/redis_scripts.rb

Overview

Represents a script in a lua file under the load path.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



117
118
119
# File 'lib/redis_scripts.rb', line 117

def name
  @name
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



117
118
119
# File 'lib/redis_scripts.rb', line 117

def path
  @path
end

Instance Method Details

#contentObject

The content of the script.



124
125
126
# File 'lib/redis_scripts.rb', line 124

def content
  @content = File.read(path)
end

#shaObject

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