class String

Public Instance Methods

cut(max_chars) click to toggle source

If string doesnt fit in `max_chars` then it will cut it and add '…'

# File lib/redmine_cli/helpers/monkey_patching.rb, line 5
def cut(max_chars)
  return self if size <= max_chars

  self[0...max_chars - 3] + '...'
end
numeric?() click to toggle source
# File lib/redmine_cli/helpers/monkey_patching.rb, line 11
def numeric?
  Integer(self)
rescue
  false
end