xeme 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/xeme.rb +26 -11
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40d47d6001c1c5b02169dd9a5018544da7dfac7385eb06c581c70cd22f9f9330
|
4
|
+
data.tar.gz: 0dcc2eee1b43a10c4caf95ecfe073a66db44f535ec7e0733cd9a22569a7bf22b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c20d4379578985940d8529fa92fe94e1990b2b49cb62d3e559cdb3b19340f64391253d444d2b26b64170192d61efc775b619277fa49a8936eaeaf0c22d928f07
|
7
|
+
data.tar.gz: 457cfe0199c7c7da8a536d77b92cd596de85298da06f67035ae02f92db2ff50d25045133020a6da8e2f28d6597cafe31e94f83aa1cc18e9bce342aadfa6ea3d5
|
data/README.md
CHANGED
@@ -280,7 +280,8 @@ mike@idocs.com
|
|
280
280
|
|
281
281
|
## History
|
282
282
|
|
283
|
-
| version | date
|
284
|
-
|
285
|
-
| 0.1 | Jan 7, 2020
|
286
|
-
| 0.2 | Jan 8, 2020
|
283
|
+
| version | date | notes |
|
284
|
+
|---------|--------------|-------------------------------|
|
285
|
+
| 0.1 | Jan 7, 2020 | Initial upload. |
|
286
|
+
| 0.2 | Jan 8, 2020 | Fixed bug in exception() |
|
287
|
+
| 0.3 | Jan 19, 2020 | Fixed bug in Xeme.from_json() |
|
data/lib/xeme.rb
CHANGED
@@ -11,8 +11,8 @@ require 'forwardable'
|
|
11
11
|
# more details.
|
12
12
|
|
13
13
|
class Xeme
|
14
|
-
#
|
15
|
-
VERSION = '0.
|
14
|
+
# version 0.3
|
15
|
+
VERSION = '0.3'
|
16
16
|
|
17
17
|
# A Xeme::Messages object, which is basically just a hash containing arrays
|
18
18
|
# for errors, warnings, and notes.
|
@@ -312,7 +312,6 @@ class Xeme
|
|
312
312
|
# from_json
|
313
313
|
#
|
314
314
|
|
315
|
-
##
|
316
315
|
# Creates a new Xeme object from a JSON structure.
|
317
316
|
|
318
317
|
def self.from_json(raw_json)
|
@@ -320,11 +319,6 @@ class Xeme
|
|
320
319
|
hsh = JSON.parse(raw_json)
|
321
320
|
rv = self.new
|
322
321
|
|
323
|
-
# explicit success or failure
|
324
|
-
if not hsh['success'].nil?
|
325
|
-
rv.success = hsh['success']
|
326
|
-
end
|
327
|
-
|
328
322
|
# messages
|
329
323
|
if messages = hsh['messages']
|
330
324
|
messages.each do |msg_type, arr|
|
@@ -333,6 +327,28 @@ class Xeme
|
|
333
327
|
end
|
334
328
|
end
|
335
329
|
|
330
|
+
# misc
|
331
|
+
if misc = hsh['misc']
|
332
|
+
misc.each do |key, val|
|
333
|
+
rv.misc[key] = val
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
# transaction
|
338
|
+
if transaction = hsh['transaction']
|
339
|
+
if transaction['timestamp']
|
340
|
+
rv.transaction.timestamp = DateTime.parse(transaction['timestamp'])
|
341
|
+
end
|
342
|
+
|
343
|
+
if transaction['request']
|
344
|
+
rv.transaction.request = transaction['request']
|
345
|
+
end
|
346
|
+
|
347
|
+
if transaction['response']
|
348
|
+
rv.transaction.response = transaction['response']
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
336
352
|
# return
|
337
353
|
return rv
|
338
354
|
end
|
@@ -564,16 +580,15 @@ class Xeme::Transaction
|
|
564
580
|
attr_accessor :request
|
565
581
|
|
566
582
|
# Gives a unique ID for these results.
|
567
|
-
|
583
|
+
attr_accessor :response
|
568
584
|
|
569
585
|
# Gives a timestamp for when these results were generated.
|
570
|
-
|
586
|
+
attr_accessor :timestamp
|
571
587
|
|
572
588
|
#---------------------------------------------------------------------------
|
573
589
|
# initialize
|
574
590
|
#
|
575
591
|
|
576
|
-
##
|
577
592
|
# Initialize does not take any parameters.
|
578
593
|
|
579
594
|
def initialize
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xeme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike O'Sullivan
|
@@ -37,7 +37,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
|
-
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.7.6
|
41
42
|
signing_key:
|
42
43
|
specification_version: 4
|
43
44
|
summary: General purpose structure for reporting results
|