Class: Demos::TicTacToe::Row

Inherits:
Hokusai::Block show all
Defined in:
ui/examples/tic_tac_toe.rb

Instance Attribute Summary

Attributes inherited from Hokusai::Block

#node, #provides, #publisher

Instance Method Summary collapse

Methods inherited from Hokusai::Block

#children, #children?, compile, computed, computed!, #draw, #draw_with, #dump, #emit, #initialize, inject, inject!, #method_missing, mount, #on_resize, provide, provides, #render, style, styles_get, template, template_from_file, template_get, #update, use, uses

Constructor Details

This class inherits a constructor from Hokusai::Block

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hokusai::Block

Instance Method Details

#emit_position(pos) ⇒ Object



101
102
103
# File 'ui/examples/tic_tac_toe.rb', line 101

def emit_position(pos)
  emit("position", pos)
end

#key(index) ⇒ Object



105
106
107
# File 'ui/examples/tic_tac_toe.rb', line 105

def key(index)
  "player_#{row_index}_#{index}"
end

#position(index) ⇒ Object



109
110
111
# File 'ui/examples/tic_tac_toe.rb', line 109

def position(index)
  [row_index, index]
end