Class: Source2MD::CodeBlock
- Inherits:
-
Object
- Object
- Source2MD::CodeBlock
- Defined in:
- lib/source2md/code_block.rb
Constant Summary collapse
- PADDING_KEEP =
2- MARK =
"# =>"
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ CodeBlock
constructor
A new instance of CodeBlock.
- #to_md ⇒ Object
Constructor Details
#initialize(code) ⇒ CodeBlock
Returns a new instance of CodeBlock.
8 9 10 |
# File 'lib/source2md/code_block.rb', line 8 def initialize(code) @code = code end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
6 7 8 |
# File 'lib/source2md/code_block.rb', line 6 def code @code end |
Instance Method Details
#to_md ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/source2md/code_block.rb', line 12 def to_md [ "```ruby", normalized_code, "```", ] * "\n" end |