Class: Ixtlan::Core::Heartbeat::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/ixtlan/core/heartbeat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(local, remote) ⇒ Resource

Returns a new instance of Resource.



8
9
10
11
12
13
# File 'lib/ixtlan/core/heartbeat.rb', line 8

def initialize(local, remote)
  @count = 0
  @failures = 0
  @local = local
  @remote = remote
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



6
7
8
# File 'lib/ixtlan/core/heartbeat.rb', line 6

def count
  @count
end

#failureObject

Returns the value of attribute failure.



6
7
8
# File 'lib/ixtlan/core/heartbeat.rb', line 6

def failure
  @failure
end

#localObject (readonly)

Returns the value of attribute local.



5
6
7
# File 'lib/ixtlan/core/heartbeat.rb', line 5

def local
  @local
end

#remoteObject (readonly)

Returns the value of attribute remote.



5
6
7
# File 'lib/ixtlan/core/heartbeat.rb', line 5

def remote
  @remote
end

Instance Method Details

#to_logObject



15
16
17
# File 'lib/ixtlan/core/heartbeat.rb', line 15

def to_log
  "update #{@local} - total: #{@count + @failures}  success: #{@count}  failures: #{@failures}"
end