Class: Blur::Commands::CommandLUT

Inherits:
Object
  • Object
show all
Defined in:
library/blur/script.rb

Overview

This is a command look-up-table with an autoincrementing index.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandLUT

Returns a new instance of CommandLUT.



9
10
11
12
# File 'library/blur/script.rb', line 9

def initialize
  @index = -1
  @commands = {}
end

Instance Attribute Details

#commandsObject

Returns the value of attribute commands.



7
8
9
# File 'library/blur/script.rb', line 7

def commands
  @commands
end

Instance Method Details

#<<(command) ⇒ Object

Inserts the command to the LUT.



17
18
19
20
# File 'library/blur/script.rb', line 17

def << command
  @commands[command] = @index += 1
  @index
end