pos

pos()
Instance Public methods

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

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)

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
2015-06-08 04:40:29
Comments
Leave a Comment

Please login to continue.