Class: GameMachine::Routes
- Inherits:
-
Object
- Object
- GameMachine::Routes
- Includes:
- Singleton
- Defined in:
- lib/game_machine/routes.rb
Instance Attribute Summary collapse
-
#entity_routes ⇒ Object
readonly
Returns the value of attribute entity_routes.
-
#game_message_routes ⇒ Object
readonly
Returns the value of attribute game_message_routes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Routes
constructor
A new instance of Routes.
- #route(id, params) ⇒ Object
Constructor Details
#initialize ⇒ Routes
Returns a new instance of Routes.
11 12 13 14 |
# File 'lib/game_machine/routes.rb', line 11 def initialize @game_message_routes = {} @entity_routes = {} end |
Instance Attribute Details
#entity_routes ⇒ Object (readonly)
Returns the value of attribute entity_routes.
4 5 6 |
# File 'lib/game_machine/routes.rb', line 4 def entity_routes @entity_routes end |
#game_message_routes ⇒ Object (readonly)
Returns the value of attribute game_message_routes.
4 5 6 |
# File 'lib/game_machine/routes.rb', line 4 def @game_message_routes end |
Class Method Details
.game_messages(&block) ⇒ Object
7 8 9 |
# File 'lib/game_machine/routes.rb', line 7 def self.(&block) instance.instance_eval(&block) end |
Instance Method Details
#route(id, params) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/game_machine/routes.rb', line 16 def route(id, params) [id] = params if params[:name] [params[:name]] = params end end |