lib/sportradar/api/nfl/conference.rb in sportradar-api-0.1.38 vs lib/sportradar/api/nfl/conference.rb in sportradar-api-0.9.0
- old
+ new
@@ -6,22 +6,10 @@
def initialize(data)
@response = data
@id = data["id"]
@name = data["name"]
@alias = data["alias"]
- set_divisions
- end
-
- private
-
- def set_divisions
- if response["division"]
- if response["division"].is_a?(Array)
- @divisions = response["division"].map {|division| Sportradar::Api::Nfl::Division.new division }
- elsif response["division"].is_a?(Hash)
- @divisions = [ Sportradar::Api::Nfl::Division.new(response["division"]) ]
- end
- end
+ @divisions = parse_into_array(selector: response["division"], klass: Sportradar::Api::Nfl::Division) if response["division"]
end
end
end
end