Sha256: 054fbe6b739e1ad91cb840d2095955e7722ab24d5a69eef001fc1152927b6aea
Contents?: true
Size: 463 Bytes
Versions: 15
Compression:
Stored size: 463 Bytes
Contents
class Jersey < String def initialize(object) super "Jersey Number #{object})" end end class BaseballPlayer < Valuable has_value :at_bats, :klass => Integer has_value :hits, :klass => Integer has_value :league, :default => 'unknown' has_value :name has_value :jersey, :klass => Jersey, :default => 'Unknown' has_value :active, :klass => Boolean has_collection :teammates def average hits/at_bats.to_f if hits && at_bats end end
Version data entries
15 entries across 15 versions & 1 rubygems