pos

pos()
Instance Public methods

# move to Tk::Text::IndexModMethods module def +(mod)

1
2
3
4
5
6
7
8
return chars(mod) if mod.kind_of?(Numeric)
 
mod = mod.to_s
if mod =~ /^\s*[+-]?\d/
  Tk::Text::IndexString.new(@id + ' + ' + mod)
else
  Tk::Text::IndexString.new(@id + ' ' + mod)
end

end

def -(mod)

1
2
3
4
5
6
7
8
9
10
return chars(-mod) if mod.kind_of?(Numeric)
 
mod = mod.to_s
if mod =~ /^\s*[+-]?\d/
  Tk::Text::IndexString.new(@id + ' - ' + mod)
elsif mod =~ /^\s*[-]\s+(\d.*)$/
  Tk::Text::IndexString.new(@id + ' - -' + $1)
else
  Tk::Text::IndexString.new(@id + ' ' + mod)
end

end

doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.