Sha256: 057aea98c13898a7d54d94e9c5841ab3c650ddf234fdb58803ef231ee3789e4f
Contents?: true
Size: 552 Bytes
Versions: 4
Compression:
Stored size: 552 Bytes
Contents
module NflData class Statline ATTRIBUTES = [ :week, :year, :rush_atts, :rush_yards, :rush_tds, :fumbles, :pass_comp, :pass_att, :pass_yards, :pass_tds, :ints, :qb_rating, :receptions, :rec_yards, :rec_tds, :nfl_player_id ] 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 end
Version data entries
4 entries across 4 versions & 1 rubygems