Class: LS4::FaultList

Inherits:
TSVData show all
Defined in:
lib/ls4/logic/fault_detector.rb

Instance Method Summary collapse

Methods inherited from TSVData

#close, #get_hash, #open

Constructor Details

#initializeFaultList

Returns a new instance of FaultList.



22
23
24
25
26
# File 'lib/ls4/logic/fault_detector.rb', line 22

def initialize
	@path = nil
	@fault_nids = []
	super()
end

Instance Method Details

#from_msgpack(msg) ⇒ Object



46
47
48
49
50
# File 'lib/ls4/logic/fault_detector.rb', line 46

def from_msgpack(msg)
	@fault_nids = msg
	on_change
	self
end

#get_listObject



38
39
40
# File 'lib/ls4/logic/fault_detector.rb', line 38

def get_list
	@fault_nids.dup
end

#include?(nid) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/ls4/logic/fault_detector.rb', line 34

def include?(nid)
	@fault_nids.include?(nid)
end

#to_msgpack(out = '') ⇒ Object



42
43
44
# File 'lib/ls4/logic/fault_detector.rb', line 42

def to_msgpack(out = '')
	@fault_nids.to_msgpack(out)
end

#update(nids) ⇒ Object



28
29
30
31
32
# File 'lib/ls4/logic/fault_detector.rb', line 28

def update(nids)
	@fault_nids = nids.dup
	on_change
	nil
end