class Cauldron::Caret
Attributes
current_depth[R]
attr_reader :line, :depth, :total_line
total_lines[R]
attr_reader :line, :depth, :total_line
Public Class Methods
new()
click to toggle source
# File lib/cauldron/caret.rb, line 8 def initialize @total_lines, @current_depth = 0, 0 #,@line = 0, 0, 0 @lines = { 0 => 0} end
Public Instance Methods
add_line(depth)
click to toggle source
TODO This approach will need re-worked to support nesting - in and out
# File lib/cauldron/caret.rb, line 14 def add_line(depth) unless @lines.has_key?(depth) @lines[depth] = 0 end @total_lines += 1 if @current_depth != depth @current_depth = depth else @lines[depth] += 1 end end
line()
click to toggle source
# File lib/cauldron/caret.rb, line 32 def line @lines[@current_depth] end
point()
click to toggle source
# File lib/cauldron/caret.rb, line 28 def point end
return_depth(depth)
click to toggle source
# File lib/cauldron/caret.rb, line 44 def return_depth(depth) @current_depth = depth end
step_in()
click to toggle source
# File lib/cauldron/caret.rb, line 36 def step_in @current_depth += 1 unless @lines.has_key?(@current_depth) @lines[@current_depth] = 0 end #@line = 0 end