sportradar-api 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sportradar/api/soccer/player.rb +8 -1
- data/lib/sportradar/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef1ef7f5050a573909c0bbaece14d11df23e78c
|
4
|
+
data.tar.gz: 622b8196510c5abfebf07c5c62a6d4843c381087
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69a8b0393098fc4f9928b02e48e0a18d7319151f25f7283f4525bb7c6ee48da20e8e09cde3768b73c577dbf10f180c233b9a7dbc2596fe95139f2aa9b6103b8b
|
7
|
+
data.tar.gz: 0b12bb6c108ce0db4cc607118145cf6d714eabd3947057991eb6a67973690871ccf25278532b0b3ed40a4747fe0201421c7b707a758e1c4543c7ee4b2dcd658c
|
data/Gemfile.lock
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|