Method: Axlsx::Comment#initialize

Defined in:
lib/axlsx/workbook/worksheet/comment.rb

#initialize(comments, options = {}) {|_self| ... } ⇒ Comment

Creates a new comment object

Parameters:

  • comments (Comments)

    The comment collection this comment belongs to

  • options (Hash) (defaults to: {})
  • [String] (Hash)

    a customizable set of options

  • [Boolean] (Hash)

    a customizable set of options

Yields:

  • (_self)

Yield Parameters:

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
21
# File 'lib/axlsx/workbook/worksheet/comment.rb', line 14

def initialize(comments, options = {})
  raise ArgumentError, "A comment needs a parent comments object" unless comments.is_a?(Comments)

  @visible = true
  @comments = comments
  parse_options options
  yield self if block_given?
end