Module: LabThingy

Defined in:
lib/lab.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#xObject

Returns the value of attribute x.



3
4
5
# File 'lib/lab.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y.



3
4
5
# File 'lib/lab.rb', line 3

def y
  @y
end

Instance Method Details

#init_lab_thingy(editor) ⇒ Object



5
6
7
8
9
# File 'lib/lab.rb', line 5

def init_lab_thingy editor
   @editor = editor
   @invalids = []
   @x, @y = 0, 0
end

#invalidate_allObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/lab.rb', line 15

def invalidate_all
   # puts "invalidate_all called"
   @invalidated_all = true
   @invalids = [] # hack - need to coalesce invalids
   (0...@editor.buffer.length).each {
      |y|
      # fix, should be length of line???
      invalidate_scan y, 0, maxx 
   }
end

#invalidate_scan(y, x1, x2) ⇒ Object



11
12
13
# File 'lib/lab.rb', line 11

def invalidate_scan y, x1, x2
   @invalids << Struct.new(:y, :x1, :x2).new(y, x1, x2)
end

#maxxObject



26
# File 'lib/lab.rb', line 26

def maxx ; raise "must be implemented" ; end

#maxyObject



27
# File 'lib/lab.rb', line 27

def maxy ; raise "must be implemented" ; end