espn_pub 0.1.11 → 0.1.12

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
  SHA256:
3
- metadata.gz: 549629bccc7f2a274c7c79e4b54c3eeb729c573275d4532ddd3013e250612fe5
4
- data.tar.gz: 5cdb779d1d7198086eb40c7efa5cf683676d55f89b10ad2d37a1d6b5f99473df
3
+ metadata.gz: 30fd533f6b593e843a5744e575737f138ea6af33963b07937696f67cb970ab47
4
+ data.tar.gz: 19d211169bb883ec04ed6548e3dc826a300d7eeaba472c1562761ef619f6b450
5
5
  SHA512:
6
- metadata.gz: 50d7e48c80b08c7384958414f39bfd57aade6ac2c3ce93d7567256970cd16d88a15421e8368b4a83ebefcd0477a30371ff08391d560b8abf4d2177b4cff9d6eb
7
- data.tar.gz: a39dbe3f2ef9b6aea6766d84c838dcabaee451aa36c3335f7cd0926446afcb613b1ec64bf1c024f77941991f87c948a651cc8972eb4fad9abf1da3118038099b
6
+ metadata.gz: 8cabbe8888557c9e5f8066c7a870bd2616a8ea2e472675e4393b051c01564c6acbd2da402a4671605684109630a82117e5674f9ba32be651d1aabfc0f1c29fb8
7
+ data.tar.gz: 818ded422a8067dc5fc44d27867e1fbfd3675feeb1b68d11335d5c23ed4e0c77a57678f1b0d6e8f26aa2f83c46436dc4d87a43761e22b46ccc7e0627dca38b74
@@ -84,8 +84,8 @@ module EspnPub
84
84
  position: athlete_data.dig('position', 'abbreviation'),
85
85
  team_id: athlete_data.dig('team', 'id'),
86
86
  date_of_birth: parse_date_of_birth(athlete_data['dateOfBirth']),
87
- height: athlete_data['displayHeight'],
88
- weight: athlete_data['displayWeight'],
87
+ height: convert_height(athlete_data['displayHeight']),
88
+ weight: convert_weight(athlete_data['displayWeight']),
89
89
  debut_year: athlete_data['debutYear']
90
90
  )
91
91
  end
@@ -108,6 +108,25 @@ module EspnPub
108
108
  rescue ArgumentError
109
109
  nil
110
110
  end
111
+
112
+ def self.convert_height(value)
113
+ return nil unless value
114
+ return value if value.is_a?(Integer)
115
+
116
+ return unless value.match(/'/)
117
+
118
+ feet, inches = value.split("'").map { |s| s.gsub(/[\s"]/, '').to_i }
119
+ (feet * 12) + inches
120
+ end
121
+
122
+ def self.convert_weight(value)
123
+ return nil unless value
124
+ return value if value.is_a?(Integer)
125
+
126
+ return unless value.match(/lbs/)
127
+
128
+ value.gsub(/ lbs/, '').to_i
129
+ end
111
130
  end
112
131
  end
113
132
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EspnPub
4
- VERSION = '0.1.11'
4
+ VERSION = '0.1.12'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espn_pub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Bowman