Class: MessagePack::IDL::AST::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/msgpack/idl/ast.rb

Instance Method Summary collapse

Instance Method Details

#summaryObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/msgpack/idl/ast.rb', line 28

def summary
	t = text
	lines = t.split("\n")
	return t if lines.size <= SUMMARY_LINES
	if lines.last == "}"
		(lines[0,SUMMARY_LINES-2] + ["    ...", "}"]).join("\n")
	else
		(lines[0,SUMMARY_LINES-1] + ["    ..."]).join("\n")
	end
end