Class: PMLCode::Display
- Inherits:
-
Object
- Object
- PMLCode::Display
- Defined in:
- lib/pmlcode/display.rb
Constant Summary collapse
- INDENT =
" " * 4
Instance Method Summary collapse
-
#initialize(content, part, options) ⇒ Display
constructor
A new instance of Display.
- #to_s ⇒ Object
Constructor Details
#initialize(content, part, options) ⇒ Display
Returns a new instance of Display.
5 6 7 8 9 |
# File 'lib/pmlcode/display.rb', line 5 def initialize(content, part, ) @content = content @part = part = end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 |
# File 'lib/pmlcode/display.rb', line 11 def to_s INDENT + "```\n" + \ @content.map(&method(:format_line)).compact.map { |l| INDENT + l }.join("\n") + "\n" + \ INDENT + "```" end |