Class: RubyXL::Workbook
Overview
Constant Summary
collapse
- CONTENT_TYPE =
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'
- REL_TYPE =
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'
LegacyWorkbook::APPLICATION, LegacyWorkbook::APPVERSION, LegacyWorkbook::SHEET_NAME_TEMPLATE
OOXMLTopLevelObject::ROOT, OOXMLTopLevelObject::SAVE_ORDER
Instance Attribute Summary collapse
#generic_storage, #relationship_container
#root
Instance Method Summary
collapse
#[], #add_worksheet, #borders, #cell_xfs, #date_to_num, #each, #fills, #fonts, #get_fill_color, #initialize, #modify_alignment, #modify_border, #modify_fill, #modify_text_wrap, #num_to_date, #register_new_fill, #register_new_font, #register_new_xf, #save, #stream
#attach_relationship, #collect_related_objects, included, #load_relationships, #store_relationship
#add_to_zip, #file_index, parse_file, set_namespaces
#==, included, #index_in_collection, #initialize, #write_xml
Instance Attribute Details
#calculation_chain ⇒ Object
Returns the value of attribute calculation_chain.
347
348
349
|
# File 'lib/rubyXL/objects/workbook.rb', line 347
def calculation_chain
@calculation_chain
end
|
#shared_strings_container ⇒ Object
Returns the value of attribute shared_strings_container.
347
348
349
|
# File 'lib/rubyXL/objects/workbook.rb', line 347
def shared_strings_container
@shared_strings_container
end
|
#stylesheet ⇒ Object
Returns the value of attribute stylesheet.
347
348
349
|
# File 'lib/rubyXL/objects/workbook.rb', line 347
def stylesheet
@stylesheet
end
|
#theme ⇒ Object
Returns the value of attribute theme.
347
348
349
|
# File 'lib/rubyXL/objects/workbook.rb', line 347
def theme
@theme
end
|
#worksheets ⇒ Object
Returns the value of attribute worksheets.
347
348
349
|
# File 'lib/rubyXL/objects/workbook.rb', line 347
def worksheets
@worksheets
end
|
Instance Method Details
#application ⇒ Object
379
380
381
|
# File 'lib/rubyXL/objects/workbook.rb', line 379
def application
root.document_properties.application && self.document_properties.application.value
end
|
#application=(v) ⇒ Object
383
384
385
386
|
# File 'lib/rubyXL/objects/workbook.rb', line 383
def application=(v)
root.document_properties.application ||= StringNode.new
root.document_properties.application.value = v
end
|
#appversion ⇒ Object
388
389
390
|
# File 'lib/rubyXL/objects/workbook.rb', line 388
def appversion
root.document_properties.app_version && root.document_properties.app_version.value
end
|
#appversion=(v) ⇒ Object
392
393
394
395
|
# File 'lib/rubyXL/objects/workbook.rb', line 392
def appversion=(v)
root.document_properties.app_version ||= StringNode.new
root.document_properties.app_version.value = v
end
|
#before_write_xml ⇒ Object
349
350
351
352
353
354
355
356
357
358
359
|
# File 'lib/rubyXL/objects/workbook.rb', line 349
def before_write_xml
self.sheets = RubyXL::Sheets.new
worksheets.each_with_index { |sheet, i|
rel = relationship_container.find_by_target(sheet.xlsx_path)
sheets << RubyXL::Sheet.new(:name => sheet.sheet_name[0..30], :sheet_id => sheet.sheet_id || (i + 1),
:state => sheet.state, :r_id => rel.id)
}
true
end
|
#company ⇒ Object
370
371
372
|
# File 'lib/rubyXL/objects/workbook.rb', line 370
def company
self.document_properties.company && self.document_properties.company.value
end
|
#company=(v) ⇒ Object
374
375
376
377
|
# File 'lib/rubyXL/objects/workbook.rb', line 374
def company=(v)
root.document_properties.company ||= StringNode.new
root.document_properties.company.value = v
end
|
#created_at ⇒ Object
413
414
415
|
# File 'lib/rubyXL/objects/workbook.rb', line 413
def created_at
root.core_properties.created_at
end
|
#created_at=(v) ⇒ Object
417
418
419
|
# File 'lib/rubyXL/objects/workbook.rb', line 417
def created_at=(v)
root.core_properties.created_at = v
end
|
#creator ⇒ Object
397
398
399
|
# File 'lib/rubyXL/objects/workbook.rb', line 397
def creator
root.core_properties.creator
end
|
#creator=(v) ⇒ Object
401
402
403
|
# File 'lib/rubyXL/objects/workbook.rb', line 401
def creator=(v)
root.core_properties.creator = v
end
|
#date1904 ⇒ Object
361
362
363
|
# File 'lib/rubyXL/objects/workbook.rb', line 361
def date1904
workbook_properties && workbook_properties.date1904
end
|
#date1904=(v) ⇒ Object
365
366
367
368
|
# File 'lib/rubyXL/objects/workbook.rb', line 365
def date1904=(v)
self.workbook_properties ||= RubyXL::WorkbookProperties.new
workbook_properties.date1904 = v
end
|
#modified_at ⇒ Object
421
422
423
|
# File 'lib/rubyXL/objects/workbook.rb', line 421
def modified_at
root.core_properties.modified_at
end
|
#modified_at=(v) ⇒ Object
425
426
427
|
# File 'lib/rubyXL/objects/workbook.rb', line 425
def modified_at=(v)
root.core_properties.modified_at = v
end
|
#modifier ⇒ Object
405
406
407
|
# File 'lib/rubyXL/objects/workbook.rb', line 405
def modifier
root.core_properties.modifier
end
|
#modifier=(v) ⇒ Object
409
410
411
|
# File 'lib/rubyXL/objects/workbook.rb', line 409
def modifier=(v)
root.core_properties.modifier = v
end
|
303
304
305
|
# File 'lib/rubyXL/objects/workbook.rb', line 303
def related_objects
[ calculation_chain, stylesheet, theme, shared_strings_container ] + @worksheets
end
|
#xlsx_path ⇒ Object
429
430
431
|
# File 'lib/rubyXL/objects/workbook.rb', line 429
def xlsx_path
ROOT.join('xl', 'workbook.xml')
end
|