Sha256: 13cb20cba4f694a1e9ce1283fe2b07db34955d2c779fa4d36d7346edb1d7f41e

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

module GameMachine
  class Routes
    include Singleton
    attr_reader :game_message_routes, :entity_routes


    def self.game_messages(&block)
      instance.instance_eval(&block)
    end

    def initialize
      @game_message_routes = {}
      @entity_routes = {}
    end

    def route(id, params)
      game_message_routes[id] = params
      if params[:name]
        game_message_routes[params[:name]] = params
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
game_machine-1.0.4 lib/game_machine/routes.rb
game_machine-1.0.2 lib/game_machine/routes.rb