Sha256: 4565076d03be295cf66e1daf3bdf46d6409d7e538ee73efa41a78bdf4130f2c0
Contents?: true
Size: 439 Bytes
Versions: 172
Compression:
Stored size: 439 Bytes
Contents
class SpaceAge attr_reader :seconds def initialize(seconds) @seconds = seconds end { mercury: 7_600_530.24, venus: 19_413_907.2, earth: 31_558_149.76, mars: 59_354_294.4, jupiter: 374_335_776.0, saturn: 929_596_608.0, uranus: 2_661_041_808.0, neptune: 5_200_418_592.0 }.each do |planet, orbital_period| define_method("on_#{planet}") do seconds / orbital_period end end end
Version data entries
172 entries across 172 versions & 1 rubygems