Class: XlsxWriter::Autofilter

Inherits:
Object
  • Object
show all
Defined in:
lib/xlsx_writer/autofilter.rb

Instance Method Summary collapse

Instance Method Details

#defined_nameObject

Sheet1!$A$1:$B$1



8
9
10
# File 'lib/xlsx_writer/autofilter.rb', line 8

def defined_name
  "#{sheet.name}!#{dollar_range}"
end

#dollar_rangeObject



12
13
14
15
# File 'lib/xlsx_writer/autofilter.rb', line 12

def dollar_range
  a = /([A-Z]+)(\d+):([A-Z]+)(\d+)/.match(range).captures.map { |c| c.prepend '$' }
  [ a.first(2).join, a.last(2).join ].join(':')
end

#to_xmlObject



3
4
5
# File 'lib/xlsx_writer/autofilter.rb', line 3

def to_xml
  %{<autoFilter ref="#{range}" />}
end