Class: VK::T

Inherits:
O
  • Object
show all
Defined in:
lib/valkey/objects.rb

Instance Attribute Summary

Attributes inherited from O

#key

Instance Method Summary collapse

Methods inherited from O

#initialize

Constructor Details

This class inherits a constructor from VK::O

Instance Method Details

#valueObject



79
80
81
# File 'lib/valkey/objects.rb', line 79

def value
  VK.redis.call("GET", key) == 'true' ? true : false  
end

#value!Object



85
86
87
88
89
90
91
# File 'lib/valkey/objects.rb', line 85

def value!
  if self.value
    self.value = false
  else
    self.value = true
  end
end

#value=(x) ⇒ Object



82
83
84
# File 'lib/valkey/objects.rb', line 82

def value= x
   VK.redis.call("SET", key, "#{x.to_s}")
end