xmlstats 1.0.0 → 1.1.0
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 -0
- data/lib/xmlstats/object.rb +16 -0
- data/lib/xmlstats/objects/event.rb +1 -0
- data/lib/xmlstats/objects/event_information.rb +1 -0
- data/lib/xmlstats/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5be7411c6d2ad7bae23b819c9f14fb8cb166008d
|
4
|
+
data.tar.gz: 9f5b9b1155487f6117310bfde1058d5fab94ab19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94ff895441f09658c3a073f4628174c5f4eecdf055f9f7579de14fa95a9d7edc5cbe0844af9c8844dce8a781fa6a0600575fa6646a96263ade9d4619c043d07e
|
7
|
+
data.tar.gz: 531d4f81ef5adb8f90b415ebf83b9565fef91139bdd64fa9a2a96911aef05aab70f1784fdd7ab41e29282d44036de91830dec7119dbafb5bf2cf38b5212ef405
|
data/README.md
CHANGED
@@ -149,6 +149,11 @@ To query the current leaders for points per game:
|
|
149
149
|
|
150
150
|
Xmlstats.nba_leaders(:points_per_game)
|
151
151
|
|
152
|
+
Examples
|
153
|
+
--------
|
154
|
+
|
155
|
+
See https://github.com/alexmchale/xmlstats-ruby/tree/master/examples
|
156
|
+
|
152
157
|
Contributing
|
153
158
|
------------
|
154
159
|
|
data/lib/xmlstats/object.rb
CHANGED
@@ -20,6 +20,13 @@ module Xmlstats
|
|
20
20
|
|
21
21
|
instance_variable_set ivar, obj
|
22
22
|
end
|
23
|
+
|
24
|
+
self.class.object_times.each do |field_name|
|
25
|
+
ivar = "@#{field_name}"
|
26
|
+
val = instance_variable_get(ivar)
|
27
|
+
time = Time.parse(val)
|
28
|
+
instance_variable_set(ivar, time)
|
29
|
+
end
|
23
30
|
end
|
24
31
|
|
25
32
|
def fields
|
@@ -41,6 +48,15 @@ module Xmlstats
|
|
41
48
|
@object_references ||= []
|
42
49
|
end
|
43
50
|
|
51
|
+
def self.time field_name
|
52
|
+
@object_times ||= []
|
53
|
+
@object_times << field_name
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.object_times
|
57
|
+
@object_times ||= []
|
58
|
+
end
|
59
|
+
|
44
60
|
end
|
45
61
|
|
46
62
|
module Objects
|
data/lib/xmlstats/version.rb
CHANGED