Class: RubyXL::Chartsheet

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

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OOXMLTopLevelObject

#add_to_zip, parse_file, set_namespaces, xlsx_path

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.



95
96
97
# File 'lib/rubyXL/objects/chartsheet.rb', line 95

def sheet_id
  @sheet_id
end

#sheet_nameObject

Returns the value of attribute sheet_name.



95
96
97
# File 'lib/rubyXL/objects/chartsheet.rb', line 95

def sheet_name
  @sheet_name
end

#stateObject

Returns the value of attribute state.



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

def state
  @state
end

#workbookObject

Returns the value of attribute workbook.



95
96
97
# File 'lib/rubyXL/objects/chartsheet.rb', line 95

def workbook
  @workbook
end

Class Method Details

.content_typeObject



91
92
93
# File 'lib/rubyXL/objects/chartsheet.rb', line 91

def self.content_type
  'application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml'
end

Instance Method Details

#rel_typeObject



87
88
89
# File 'lib/rubyXL/objects/chartsheet.rb', line 87

def rel_type
  'chartsheet'
end

#sheet_indexObject



79
80
81
# File 'lib/rubyXL/objects/chartsheet.rb', line 79

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

#xlsx_pathObject



83
84
85
# File 'lib/rubyXL/objects/chartsheet.rb', line 83

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