Sha256: 263f595256fd8cbdb3fb9a09aeeed7d3f89253e51f32ce3261298b50f8d208b3
Contents?: true
Size: 384 Bytes
Versions: 8
Compression:
Stored size: 384 Bytes
Contents
# run system with a single command module Runnable def run reject!(&:done?) each(&:display) end end # A custom enumerable class, it is so easy in ruby class ParticleSystem include Enumerable, Runnable extend Forwardable def_delegators(:@pairs, :each, :reject!, :<<) def initialize @pairs = [] end def add_pair(x, y) self << Pair.new(x, y) end end
Version data entries
8 entries across 8 versions & 1 rubygems