Class: Osheet::Column

Inherits:
Object
  • Object
show all
Includes:
MetaElement, StyledElement
Defined in:
lib/osheet/column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StyledElement

#style_class

Methods included from MetaElement

#meta

Constructor Details

#initialize(width = nil) ⇒ Column

Returns a new instance of Column.



13
14
15
16
17
18
# File 'lib/osheet/column.rb', line 13

def initialize(width=nil)
  @width   = width
  @autofit = false
  @hidden  = false
  @format  = Format.new(:general)
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



11
12
13
# File 'lib/osheet/column.rb', line 11

def format
  @format
end

Instance Method Details

#autofit(value = nil) ⇒ Object



24
25
26
# File 'lib/osheet/column.rb', line 24

def autofit(value=nil)
  value.nil? ? @autofit : @autofit = !!value
end

#autofit?Boolean

Returns:

  • (Boolean)


27
# File 'lib/osheet/column.rb', line 27

def autofit?; @autofit; end

#hidden(value = nil) ⇒ Object



29
30
31
# File 'lib/osheet/column.rb', line 29

def hidden(value=nil)
  value.nil? ? @hidden : @hidden = !!value
end

#hidden?Boolean

Returns:

  • (Boolean)


32
# File 'lib/osheet/column.rb', line 32

def hidden?; @hidden; end

#width(value = nil) ⇒ Object



20
21
22
# File 'lib/osheet/column.rb', line 20

def width(value=nil)
  value.nil? ? @width : @width = value
end