Class | Spreadsheet::Column |
In: |
lib/spreadsheet/column.rb
|
Parent: | Object |
The Column class. Encapsulates column-formatting and width, and provides a means to iterate over all cells in a column.
Useful Attributes:
width: | The width in characters (in respect to the ‘0’ character of the Worksheet‘s default Font). Float values are permitted, for Excel the available Precision is at 1/256 characters. |
default_format: | The default Format for cells in this column (applied if there is no explicit Cell Format and no default Row format for the Cell). |
hidden: | The Column is hidden. |
collapsed: | The Column is collapsed. |
outline_level: | Outline level of the column. |
default_format | [R] | |
idx | [R] | |
width | [RW] | |
worksheet | [RW] |
# File lib/spreadsheet/column.rb, line 41 41: def initialize idx, format, opts={} 42: @worksheet = nil 43: @idx = idx 44: opts[:width] ||= 10 45: opts.each do |key, value| 46: self.send "#{key}=", value 47: end 48: self.default_format = format 49: end
# File lib/spreadsheet/column.rb, line 21 21: def updater *keys 22: keys.each do |key| 23: unless instance_methods.include? "unupdated_#{key}=" 24: alias_method "unupdated_#{key}=""unupdated_#{key}=", "#{key}=""#{key}=" 25: define_method "#{key}=" do |value| 26: send "unupdated_#{key}=", value 27: @worksheet.column_updated @idx, self if @worksheet 28: value 29: end 30: end 31: end 32: end