ohmage 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ohmage.rb +1 -0
- data/lib/ohmage/api.rb +2 -0
- data/lib/ohmage/audit.rb +19 -0
- data/lib/ohmage/entity/audit.rb +17 -0
- data/lib/ohmage/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c599303425d092be3a0add882ca862efef9438b
|
4
|
+
data.tar.gz: 3236d1ca01efcb43186588a37d66a05b4470f13d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502a3c3c0cf42b78fc666b6e18b6afc5e7762e230765cb53f5f3d3aacb813c3b59e045160532f48ee38e357656d39206b0c6d34818eb72a7bae9464f7ffda066
|
7
|
+
data.tar.gz: fe36ecb36e90d14444822fdc08ce6d5bca3c49310b6b75f67b47c86132bb12513a9fda60b7a5b83bfb66b7ee67929fa706556801d7b364c27ebbc46050df1c5b
|
data/lib/ohmage.rb
CHANGED
data/lib/ohmage/api.rb
CHANGED
@@ -4,6 +4,7 @@ require 'ohmage/clazz'
|
|
4
4
|
require 'ohmage/document'
|
5
5
|
require 'ohmage/media'
|
6
6
|
require 'ohmage/survey'
|
7
|
+
require 'ohmage/audit'
|
7
8
|
|
8
9
|
module Ohmage
|
9
10
|
module API
|
@@ -13,5 +14,6 @@ module Ohmage
|
|
13
14
|
include Ohmage::API::Document
|
14
15
|
include Ohmage::API::Media
|
15
16
|
include Ohmage::API::Survey
|
17
|
+
include Ohmage::API::Audit
|
16
18
|
end
|
17
19
|
end
|
data/lib/ohmage/audit.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Ohmage
|
2
|
+
module API
|
3
|
+
module Audit
|
4
|
+
#
|
5
|
+
# ohmage audit/read call
|
6
|
+
# @see https://github.com/ohmage/server/wiki/Audit-APIs#auditRead
|
7
|
+
# @returns [Array: Ohmage::Audit objects] matching criteria and output format
|
8
|
+
def audit_read(params = {})
|
9
|
+
request = Ohmage::Request.new(self, :post, 'audit/read', params)
|
10
|
+
# TODO: make a utility to abstract creation of array of base objects
|
11
|
+
t = []
|
12
|
+
request.perform[:audits].each do |k, v|
|
13
|
+
t << Ohmage::Audit.new(k => v)
|
14
|
+
end
|
15
|
+
t
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Ohmage
|
2
|
+
class Audit
|
3
|
+
# @return [String]
|
4
|
+
attr_reader :timestamp, :client, :request_type, :uri
|
5
|
+
# @return [Hash]
|
6
|
+
attr_reader :response, :request_parameters, :extra_data
|
7
|
+
# @return [Fixnum]
|
8
|
+
attr_reader :responded_millis, :received_millis
|
9
|
+
|
10
|
+
def initialize(attrs = {})
|
11
|
+
attrs.keys[0].each do |k, v|
|
12
|
+
instance_variable_set("@#{k}", v)
|
13
|
+
end
|
14
|
+
@duration_millis = @responded_millis - @received_millis
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/ohmage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohmage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Nolen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -78,12 +78,14 @@ files:
|
|
78
78
|
- bin/ohmage
|
79
79
|
- lib/ohmage.rb
|
80
80
|
- lib/ohmage/api.rb
|
81
|
+
- lib/ohmage/audit.rb
|
81
82
|
- lib/ohmage/campaign.rb
|
82
83
|
- lib/ohmage/clazz.rb
|
83
84
|
- lib/ohmage/cli.rb
|
84
85
|
- lib/ohmage/cli_helpers.rb
|
85
86
|
- lib/ohmage/client.rb
|
86
87
|
- lib/ohmage/document.rb
|
88
|
+
- lib/ohmage/entity/audit.rb
|
87
89
|
- lib/ohmage/entity/campaign.rb
|
88
90
|
- lib/ohmage/entity/clazz.rb
|
89
91
|
- lib/ohmage/entity/document.rb
|