Sha256: 2860314d92730bac510d4252fab7fb8b396f5ddc487678eeed05acab23ba3706

Contents?: true

Size: 643 Bytes

Versions: 8

Compression:

Stored size: 643 Bytes

Contents

require 'passive_record'
require 'frappuccino'

require 'metacosm/version'
require 'metacosm/model'
require 'metacosm/simulation'

module Metacosm
  class View
    include PassiveRecord
  end

  class Command
    include PassiveRecord

    def attrs
      to_h.keep_if { |k,_| k != :id }
    end

    def ==(other)
      attrs == other.attrs
    end
  end

  class Event
    include PassiveRecord

    def attrs
      to_h.keep_if { |k,_| k != :id }
    end

    def ==(other)
      attrs == other.attrs
    end
  end

  class EventListener < Struct.new(:simulation)
    def fire(command)
      self.simulation.fire(command)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metacosm-0.2.8 lib/metacosm.rb
metacosm-0.2.7 lib/metacosm.rb
metacosm-0.2.6 lib/metacosm.rb
metacosm-0.2.5 lib/metacosm.rb
metacosm-0.2.4 lib/metacosm.rb
metacosm-0.2.3 lib/metacosm.rb
metacosm-0.2.2 lib/metacosm.rb
metacosm-0.2.1 lib/metacosm.rb