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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9967022fabf719efee4efde2fcd3e5686f06a205
4
- data.tar.gz: fb93ca12dd6903b6f3738b2faeb13f604a454b3a
3
+ metadata.gz: 5be7411c6d2ad7bae23b819c9f14fb8cb166008d
4
+ data.tar.gz: 9f5b9b1155487f6117310bfde1058d5fab94ab19
5
5
  SHA512:
6
- metadata.gz: f5538f92973552825b7721560fbc5d0410cbd4db77641100ba6f2ffb278895eaf3d9071c4581e5a67a8551a5da05ee8598d7ab94f76ea808c9149cf61b2a7714
7
- data.tar.gz: 102ee492791150df296634f048c5532e0a200ab8296f14d988891d63f8dafa8895f17a9c9d5f2573d8085905bb05aec62b5db9dd179424069182cfaad3571fe1
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
 
@@ -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
@@ -3,5 +3,6 @@ class Xmlstats::Objects::Event < Xmlstats::Object
3
3
  reference :away_team, Xmlstats::Objects::Team
4
4
  reference :home_team, Xmlstats::Objects::Team
5
5
  reference :site, Xmlstats::Objects::Site
6
+ time :start_date_time
6
7
 
7
8
  end
@@ -1,5 +1,6 @@
1
1
  class Xmlstats::Objects::EventInformation < Xmlstats::Object
2
2
 
3
3
  reference :site, Xmlstats::Objects::Site
4
+ time :start_date_time
4
5
 
5
6
  end
@@ -1,3 +1,3 @@
1
1
  module Xmlstats
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmlstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McHale