Class: Axlsx::Break

Inherits:
Object
  • Object
show all
Includes:
Accessors, OptionsParser, SerializedAttributes
Defined in:
lib/axlsx/workbook/worksheet/break.rb

Overview

The Break class stores the details for row and column page breaks.

See Also:

  • ColBreaks

Instance Method Summary collapse

Methods included from SerializedAttributes

#declared_attributes, included, #serialized_attributes, #serialized_element_attributes

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Break

Creates a new Break object

Parameters:

  • options (defaults to: {})

    A hash of attribute options for this break.

  • option (Hash)

    a customizable set of options

Options Hash (options):

  • id (Integer)

    Zero-based row or column Id of the page break. Breaks occur above the specified row and left of the specified column.

  • min (Integer)

    Zero-based index of start row or column of the break. For row breaks, specifies column index; for column breaks, specifies row index.

  • max (Integer)

    Zero-based index of end row or column of the break. For row breaks, specifies column index; for column breaks, specifies row index.

  • man (Boolean)

    Manual Break flag. 1 means the break is a manually inserted break.

Yields:

  • (_self)

Yield Parameters:

  • _self (Axlsx::Break)

    the object that the method was called on



18
19
20
21
# File 'lib/axlsx/workbook/worksheet/break.rb', line 18

def initialize(options={})
  parse_options options
  yield self if block_given?
end

Instance Method Details

#to_xml_string(str = '') ⇒ Object

serializes the break to xml



30
31
32
33
34
# File 'lib/axlsx/workbook/worksheet/break.rb', line 30

def to_xml_string(str='')
  str << '<brk '
  serialized_attributes str
  str << '></brk>'
end