Class: RubyXL::Chartsheet

Inherits:
OOXMLTopLevelObject show all
Defined in:
lib/rubyXL/objects/chartsheet.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OOXMLTopLevelObject

#add_to_zip, filepath, parse_file, set_namespaces

Methods included from OOXMLObjectClassMethods

#define_attribute, #define_child_node, #define_element_name, #obtain_class_variable, #parse, #set_countable

Methods included from OOXMLObjectInstanceMethods

#before_write_xml, #dup, #index_in_collection, #initialize, #write_xml

Instance Attribute Details

#sheet_idObject

Returns the value of attribute sheet_id.



89
90
91
# File 'lib/rubyXL/objects/chartsheet.rb', line 89

def sheet_id
  @sheet_id
end

#sheet_nameObject

Returns the value of attribute sheet_name.



89
90
91
# File 'lib/rubyXL/objects/chartsheet.rb', line 89

def sheet_name
  @sheet_name
end

#workbookObject

Returns the value of attribute workbook.



89
90
91
# File 'lib/rubyXL/objects/chartsheet.rb', line 89

def workbook
  @workbook
end

Instance Method Details

#filepathObject



81
82
83
# File 'lib/rubyXL/objects/chartsheet.rb', line 81

def filepath
  File.join('xl', 'chartsheets', "sheet#{sheet_index + 1}.xml")
end

#rel_typeObject



85
86
87
# File 'lib/rubyXL/objects/chartsheet.rb', line 85

def rel_type
  'chartsheet'
end

#sheet_indexObject



77
78
79
# File 'lib/rubyXL/objects/chartsheet.rb', line 77

def sheet_index
  @workbook.worksheets.select{ |sheet| sheet.is_a?(self.class) }.index{ |sheet| sheet.equal?(self) }
end