Class: Redis::Lua::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/redis/lua.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, text) ⇒ Script

Returns a new instance of Script.



48
49
50
51
52
# File 'lib/redis/lua.rb', line 48

def initialize(name, text)
  @name = name.to_sym
  @text = text.dup.freeze
  @sha  = Digest::SHA1.hexdigest(text).freeze
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



46
47
48
# File 'lib/redis/lua.rb', line 46

def name
  @name
end

#shaObject (readonly)

Returns the value of attribute sha.



46
47
48
# File 'lib/redis/lua.rb', line 46

def sha
  @sha
end

#textObject (readonly)

Returns the value of attribute text.



46
47
48
# File 'lib/redis/lua.rb', line 46

def text
  @text
end