lib/nfl_data/models/player.rb in nfl_data-0.0.14 vs lib/nfl_data/models/player.rb in nfl_data-0.1.0

- old
+ new

@@ -1,20 +1,13 @@ module NflData - class Player - ATTRIBUTES = [ - :first_name, :last_name, :full_name, :position, :number, - :status, :team, :nfl_player_id, :picture_link, :profile_link - ] - - attr_accessor(*ATTRIBUTES) - - def initialize(attributes = {}) - attributes.each { |attr, value| send("#{attr}=", value) } - end - - def to_hash - attributes_hash = {} - ATTRIBUTES.each { |attr| attributes_hash.merge!(attr => send(attr)) } - attributes_hash - end - end + Player = Struct.new( + :first_name, + :last_name, + :full_name, + :position, + :number, + :team, + :msf_player_id, + :image_source, + keyword_init: true + ) end