Module: LabThingy
- Defined in:
- lib/lab.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #init_lab_thingy(editor) ⇒ Object
- #invalidate_all ⇒ Object
- #invalidate_scan(y, x1, x2) ⇒ Object
- #maxx ⇒ Object
- #maxy ⇒ Object
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
3 4 5 |
# File 'lib/lab.rb', line 3 def x @x end |
#y ⇒ Object
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_all ⇒ Object
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 |
#maxx ⇒ Object
26 |
# File 'lib/lab.rb', line 26 def maxx ; raise "must be implemented" ; end |
#maxy ⇒ Object
27 |
# File 'lib/lab.rb', line 27 def maxy ; raise "must be implemented" ; end |