Class: NodeHeartbeat::BeatOnce

Inherits:
Base
  • Object
show all
Defined in:
lib/node_heartbeat/beat_once.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

call

Constructor Details

#initialize(bucket:) ⇒ BeatOnce

Returns a new instance of BeatOnce.



9
10
11
# File 'lib/node_heartbeat/beat_once.rb', line 9

def initialize(bucket:)
  self.bucket = bucket
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket.



7
8
9
# File 'lib/node_heartbeat/beat_once.rb', line 7

def bucket
  @bucket
end

Instance Method Details

#callObject



13
14
15
16
17
# File 'lib/node_heartbeat/beat_once.rb', line 13

def call
  puts 'Heartbeat!'
  private_ip = GetPrivateIP.call.private_ip
  UploadIP.call(ip: private_ip, bucket: self.bucket)
end