lib/sportradar/api/basketball/nba/conference.rb in sportradar-api-0.11.69 vs lib/sportradar/api/basketball/nba/conference.rb in sportradar-api-0.12.0
- old
+ new
@@ -7,13 +7,20 @@
def initialize(data, **opts)
@response = data
@api = opts[:api]
- @id = data["id"]
- @name = data["name"]
+ @divisions_hash = {}
+
+ update(data, **opts)
+ end
+
+ def update(data, **opts)
+ @id = data["id"]
+ @name = data["name"]
@alias = data["alias"]
- @divisions_hash = create_data({}, data["divisions"], klass: Division, conference: self, api: @api) # if response["division"]
+
+ create_data(@divisions_hash, data["divisions"], klass: Division, conference: self, api: @api) if response["divisions"]
end
def divisions
@divisions_hash.values
end