Class: Vectra::Detections

Inherits:
Object
  • Object
show all
Defined in:
lib/vectra/detections.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#targetObject

Returns the value of attribute target.



4
5
6
# File 'lib/vectra/detections.rb', line 4

def target
  @target
end

Class Method Details

.allObject



7
8
9
# File 'lib/vectra/detections.rb', line 7

def self.all
  Vectra::API.pull(@target)
end

.get(id) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/vectra/detections.rb', line 17

def self.get(id)
  unless id.is_a? Integer
    id = id.split("/").last
  end

  Vectra::API.pull("#{@target}/#{id}")
end

Instance Method Details

#eachObject



11
12
13
14
15
# File 'lib/vectra/detections.rb', line 11

def each
  self.all.each do |host|
    yield host
  end
end