Class: DeadmanCheck::KeySet
- Inherits:
-
Object
- Object
- DeadmanCheck::KeySet
- Defined in:
- lib/deadman_check_keyset.rb
Overview
KeySet Class
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#key ⇒ Object
Returns the value of attribute key.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #_update_redis_key(host, port, key) ⇒ Object
-
#initialize(host, port, key) ⇒ KeySet
constructor
A new instance of KeySet.
- #run_redis_key_update ⇒ Object
Constructor Details
#initialize(host, port, key) ⇒ KeySet
Returns a new instance of KeySet.
10 11 12 13 14 |
# File 'lib/deadman_check_keyset.rb', line 10 def initialize(host, port, key) @host = host @port = port @key = key end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
8 9 10 |
# File 'lib/deadman_check_keyset.rb', line 8 def host @host end |
#key ⇒ Object
Returns the value of attribute key.
8 9 10 |
# File 'lib/deadman_check_keyset.rb', line 8 def key @key end |
#port ⇒ Object
Returns the value of attribute port.
8 9 10 |
# File 'lib/deadman_check_keyset.rb', line 8 def port @port end |
Instance Method Details
#_update_redis_key(host, port, key) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/deadman_check_keyset.rb', line 16 def _update_redis_key(host, port, key) epoch_time_now = DeadmanCheck::DeadmanCheckGlobal.new.get_epoch_time redis = Redis.new(:host => host, :port => port) redis.set(key, epoch_time_now) puts "Redis key #{key} updated EPOCH to #{epoch_time_now}" end |
#run_redis_key_update ⇒ Object
23 24 25 |
# File 'lib/deadman_check_keyset.rb', line 23 def run_redis_key_update _update_redis_key(@host, @port, @key) end |