Class: Osheet::Column
- Inherits:
-
Object
- Object
- Osheet::Column
- Includes:
- Instance, MarkupElement, MetaElement, StyledElement, WorkbookElement, WorksheetElement
- Defined in:
- lib/osheet/column.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #autofit(value) ⇒ Object
- #autofit? ⇒ Boolean
- #hidden(value) ⇒ Object
- #hidden? ⇒ Boolean
-
#initialize(workbook = nil, worksheet = nil, *args, &block) ⇒ Column
constructor
A new instance of Column.
- #width(value = nil) ⇒ Object
Methods included from MarkupElement
Methods included from MetaElement
Methods included from StyledElement
Methods included from WorksheetElement
Methods included from WorkbookElement
Constructor Details
#initialize(workbook = nil, worksheet = nil, *args, &block) ⇒ Column
Returns a new instance of Column.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/osheet/column.rb', line 10 def initialize(workbook=nil, worksheet=nil, *args, &block) set_ivar(:workbook, workbook) set_ivar(:worksheet, worksheet) set_ivar(:width, nil) set_ivar(:autofit, false) set_ivar(:hidden, false) if block_given? set_binding_ivars(block.binding) instance_exec(*args, &block) end end |
Instance Method Details
#attributes ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/osheet/column.rb', line 30 def attributes { :style_class => get_ivar(:style_class), :width => get_ivar(:width), :autofit => get_ivar(:autofit), :hidden => get_ivar(:hidden) } end |
#autofit(value) ⇒ Object
25 |
# File 'lib/osheet/column.rb', line 25 def autofit(value); set_ivar(:autofit, !!value); end |
#autofit? ⇒ Boolean
26 |
# File 'lib/osheet/column.rb', line 26 def autofit?; get_ivar(:autofit); end |
#hidden(value) ⇒ Object
27 |
# File 'lib/osheet/column.rb', line 27 def hidden(value); set_ivar(:hidden, !!value); end |
#hidden? ⇒ Boolean
28 |
# File 'lib/osheet/column.rb', line 28 def hidden?; get_ivar(:hidden); end |
#width(value = nil) ⇒ Object
22 23 24 |
# File 'lib/osheet/column.rb', line 22 def width(value=nil) !value.nil? ? set_ivar(:width, value) : get_ivar(:width) end |