vectra 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53de84b919e4f477a7dacbe8066df6d7ba62f457
4
- data.tar.gz: c3a59be8da5e83badb23f3a034a2fccae4d8044b
3
+ metadata.gz: 3c9a1c188116e3e862f39524b91e6b7a6caa67ac
4
+ data.tar.gz: e3432222c1f70cb6fe51c36fb487d9deed5868b3
5
5
  SHA512:
6
- metadata.gz: 35ba198580d653156a267523b8ae48fd8da81179fd39f49ac14a9fffabaff6a9444a0042ffb09603004688140661ba584a160a21179735f98e77dc28399cc12d
7
- data.tar.gz: 4c0a5c10633dbfd9acd06c794d5c9aad9d1d88210a8663287e6586085f44539f2a51e34717c6763df3ca80b16c9bff54f12715efee78c0e67db2a48babebddae
6
+ metadata.gz: d9a6c36c751bf22194a6f3e48015801d64e5cc8a5a6e408877f4dfec524f5e295ff3c131e130d289d9a052aed694525a7154f47cc837618e0ec624d59e9b2aa3
7
+ data.tar.gz: 7b68a33208086df1fad9b6602cc30b1b3467b11fb341980ca2e2ee2fea82a8570686642ee0e8f2fc68d0cb3a2e13c373a7c5f6ba84ee34d6a92e8f072897ed7a
@@ -1,18 +1,25 @@
1
1
  module Vectra
2
2
  class Rules
3
-
4
- attr_reader :id
5
3
 
6
- def self.target
7
- "rules"
8
- end
4
+ attr_accessor :target
5
+ @target = "/rules"
9
6
 
10
7
  def self.all
11
- request
8
+ Vectra::API.pull(@target)
12
9
  end
13
10
 
11
+ def each
12
+ self.all.each do |host|
13
+ yield host
14
+ end
15
+ end
16
+
14
17
  def self.get(id)
15
- request("/#{id}", false)
18
+ unless id.is_a? Integer
19
+ id = id.split("/").last
20
+ end
21
+
22
+ Vectra::API.pull("#{@target}/#{id}")
16
23
  end
17
24
 
18
25
  end
@@ -1,18 +1,25 @@
1
1
  module Vectra
2
2
  class Sensors
3
3
 
4
- attr_reader :id
5
-
6
- def self.target
7
- "sensors"
8
- end
4
+ attr_accessor :target
5
+ @target = "/sensors"
9
6
 
10
7
  def self.all
11
- request
8
+ Vectra::API.pull(@target)
12
9
  end
13
10
 
11
+ def each
12
+ self.all.each do |host|
13
+ yield host
14
+ end
15
+ end
16
+
14
17
  def self.get(id)
15
- request("/#{id}", false)
18
+ unless id.is_a? Integer
19
+ id = id.split("/").last
20
+ end
21
+
22
+ Vectra::API.pull("#{@target}/#{id}")
16
23
  end
17
24
 
18
25
  end
@@ -1,3 +1,3 @@
1
1
  module Vectra
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vectra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Mackintosh