Class: RDoc::Constant

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/generator/latex_markup.rb

Constant Summary collapse

LATEX_VALUE_LENGTH =

No more characters than specified here will be shown as a constant’s value. If the content is longer, an ellipsis will be put at the end of the value.

10

Instance Method Summary collapse

Instance Method Details

#latexized_valueObject

Shortens the value to LATEX_VALUE_LENGTH characters (plus ellipsis …) and escapes all LaTeX control characters.



153
154
155
156
157
158
159
160
# File 'lib/rdoc/generator/latex_markup.rb', line 153

def latexized_value
  if value.chars.count > LATEX_VALUE_LENGTH
    str = formatter.escape(value.chars.first(LATEX_VALUE_LENGTH).join) + "\\ldots"
  else
    str = formatter.escape(value)
  end
  str
end