Class: Osheet::Row

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StyledElement

#style_class

Methods included from MetaElement

#meta

Constructor Details

#initialize(height = nil) ⇒ Row

Returns a new instance of Row.



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

def initialize(height=nil)
  @height  = height
  @autofit = false
  @hidden  = false
  @cells   = []
  @format  = Format.new(:general)
end

Instance Attribute Details

#cellsObject (readonly)

Returns the value of attribute cells.



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

def cells
  @cells
end

#formatObject (readonly)

Returns the value of attribute format.



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

def format
  @format
end

Instance Method Details

#autofit(value = nil) ⇒ Object



25
26
27
# File 'lib/osheet/row.rb', line 25

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

#autofit?Boolean

Returns:

  • (Boolean)


28
# File 'lib/osheet/row.rb', line 28

def autofit?; @autofit; end

#cell(cell_obj) ⇒ Object



35
36
37
# File 'lib/osheet/row.rb', line 35

def cell(cell_obj)
  @cells << cell_obj
end

#height(value = nil) ⇒ Object



21
22
23
# File 'lib/osheet/row.rb', line 21

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

#hidden(value = nil) ⇒ Object



30
31
32
# File 'lib/osheet/row.rb', line 30

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

#hidden?Boolean

Returns:

  • (Boolean)


33
# File 'lib/osheet/row.rb', line 33

def hidden?; @hidden; end