Class: OpenXML::SpreadsheetML::MergeCell

Inherits:
Struct
  • Object
show all
Defined in:
lib/xlsx/sheet.rb,
lib/xlsx/sheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rangeObject

Returns the value of attribute range

Returns:

  • (Object)

    the current value of range



3
4
5
# File 'lib/xlsx/sheet.rb', line 3

def range
  @range
end

Instance Method Details

#include?(index) ⇒ Boolean

Returns:

  • (Boolean)


149
150
151
152
153
154
155
156
157
158
# File 'lib/xlsx/sheet.rb', line 149

def include? index
  /([A-Z]+)(\d+):([A-Z]+)(\d+)/.match(self.range)
  col_span = ($1..$3)
  row_span = ($2..$4)
  /([A-Z]+)(\d+)/.match(index)
  col = $1
  row = $2
  return true if col_span.include?(col) && row_span.include?(row)
  false
end

#top_leftObject



160
161
162
# File 'lib/xlsx/sheet.rb', line 160

def top_left
  self.range.split(/:/)[0]
end