Class: Tocer::Elements::CommentBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/tocer/elements/comment_block.rb

Overview

Represents a table of contents start and finish comment block.

Instance Method Summary collapse

Constructor Details

#initialize(start_id: "Tocer[start]", finish_id: "Tocer[finish]", message: "Auto-generated, don't remove.") ⇒ CommentBlock

Returns a new instance of CommentBlock.



7
8
9
10
11
# File 'lib/tocer/elements/comment_block.rb', line 7

def initialize start_id: "Tocer[start]", finish_id: "Tocer[finish]", message: "Auto-generated, don't remove."
  @start_id = start_id
  @finish_id = finish_id
  @message = message
end

Instance Method Details

#finishObject



21
22
23
# File 'lib/tocer/elements/comment_block.rb', line 21

def finish
  comment finish_id, message
end

#finish_index(collection) ⇒ Object



25
26
27
# File 'lib/tocer/elements/comment_block.rb', line 25

def finish_index collection
  index collection, finish_id
end

#startObject



13
14
15
# File 'lib/tocer/elements/comment_block.rb', line 13

def start
  comment start_id, message
end

#start_index(collection) ⇒ Object



17
18
19
# File 'lib/tocer/elements/comment_block.rb', line 17

def start_index collection
  index collection, start_id
end