Class: LUIT::ScannerInput

Inherits:
Object
  • Object
show all
Defined in:
lib/luit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(holder, id) ⇒ ScannerInput

Returns a new instance of ScannerInput.



169
170
171
172
173
174
# File 'lib/luit.rb', line 169

def initialize(holder, id)
	@field = Gosu::TextInput.new
	@window = LUIT.window
	@holder = holder
	@id = id
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



168
169
170
# File 'lib/luit.rb', line 168

def field
  @field
end

#scanningObject (readonly)

Returns the value of attribute scanning.



168
169
170
# File 'lib/luit.rb', line 168

def scanning
  @scanning
end

Instance Method Details

#scanObject



181
182
183
184
# File 'lib/luit.rb', line 181

def scan
	@scaning = true
	@window.text_input = @field
end

#stopObject



176
177
178
179
# File 'lib/luit.rb', line 176

def stop
	@scaning = false
	@window.text_input = nil if @window.text_input == @field
end