sportradar-api 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6490e106ba9dbb70714fec8f71f887d04d326bc
4
- data.tar.gz: d543afa3dd174cb8474b587aab4d7c4aed0abee0
3
+ metadata.gz: bef1ef7f5050a573909c0bbaece14d11df23e78c
4
+ data.tar.gz: 622b8196510c5abfebf07c5c62a6d4843c381087
5
5
  SHA512:
6
- metadata.gz: 0a4aefbaec43b2fecb5321a56bb8e1b8564cfe57bebf4ed7772e017436612fda3cd591e484b38b02395b0eba0b78443798f6e653545782a7587d00c5dd5a18f5
7
- data.tar.gz: 5801546101faa055deb90dada2fab0386caa49b3d6372d5f5e6eaf6cd88667f043af160c1d4f718ae76941f9e0ad200ec83f8f97c0c9c4adc0cf5be826d4421d
6
+ metadata.gz: 69a8b0393098fc4f9928b02e48e0a18d7319151f25f7283f4525bb7c6ee48da20e8e09cde3768b73c577dbf10f180c233b9a7dbc2596fe95139f2aa9b6103b8b
7
+ data.tar.gz: 0b12bb6c108ce0db4cc607118145cf6d714eabd3947057991eb6a67973690871ccf25278532b0b3ed40a4747fe0201421c7b707a758e1c4543c7ee4b2dcd658c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.1.12)
4
+ sportradar-api (0.1.13)
5
5
  activesupport
6
6
  httparty (>= 0.13.3)
7
7
 
@@ -2,7 +2,7 @@ module Sportradar
2
2
  module Api
3
3
  class Soccer::Player < Data
4
4
 
5
- attr_accessor :id, :first_name, :last_name, :country_code, :country, :reference_id, :full_first_name, :full_last_name, :position, :started, :jersey_number, :tactical_position, :tactical_order, :statistics, :preferred_foot, :birthdate, :height_in, :weight_lb, :height_cm, :weight_kg, :teams, :response, :rank, :total, :statistics, :last_modified
5
+ attr_accessor :id, :first_name, :last_name, :country_code, :country, :reference_id, :full_first_name, :full_last_name, :position, :started, :jersey_number, :tactical_position, :tactical_order, :statistics, :preferred_foot, :birthdate, :height_in, :weight_lb, :height_cm, :weight_kg, :teams, :response, :rank, :total, :statistics, :last_modified, :age
6
6
 
7
7
  def initialize(data)
8
8
  @response = data
@@ -28,6 +28,7 @@ module Sportradar
28
28
  @weight_lb = data["weight_lb"]
29
29
  @height_cm = data["height_cm"]
30
30
  @weight_kg = data["weight_kg"]
31
+ @age = age
31
32
  set_teams
32
33
 
33
34
  @rank = data["rank"]
@@ -55,6 +56,12 @@ module Sportradar
55
56
  tactical_positions[tactical_position] if tactical_position
56
57
  end
57
58
 
59
+ def age
60
+ now = Time.now.utc.to_date
61
+ dob = @birthdate.to_date
62
+ now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
63
+ end
64
+
58
65
  private
59
66
 
60
67
  def set_teams
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.1.12"
3
+ VERSION = "0.1.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportradar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-23 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler