Class: Osheet::Worksheet

Inherits:
Object
  • Object
show all
Includes:
Associations, Instance, MarkupElement, MetaElement, WorkbookElement
Defined in:
lib/osheet/worksheet.rb

Instance Method Summary collapse

Methods included from MarkupElement

#add

Methods included from MetaElement

#meta

Methods included from WorkbookElement

#workbook

Methods included from Associations

included

Constructor Details

#initialize(workbook = nil, *args, &block) ⇒ Worksheet

Returns a new instance of Worksheet.



15
16
17
18
19
20
21
22
# File 'lib/osheet/worksheet.rb', line 15

def initialize(workbook=nil, *args, &block)
  set_ivar(:workbook, workbook)
  set_ivar(:name, nil)
  if block_given?
    set_binding_ivars(block.binding)
    instance_exec(*args, &block)
  end
end

Instance Method Details

#attributesObject



28
29
30
# File 'lib/osheet/worksheet.rb', line 28

def attributes
  { :name => get_ivar(:name) }
end

#name(value = nil) ⇒ Object



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

def name(value=nil)
  !value.nil? ? set_ivar(:name, sanitized_name(value)) : get_ivar(:name)
end