Class: RubyXL::Stylesheet
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
#add_to_zip, parse_file, set_namespaces, #xlsx_path
#define_attribute, #define_child_node, #define_element_name, #obtain_class_variable, #parse, #set_countable
#before_write_xml, #dup, #index_in_collection, #write_xml
Constructor Details
#initialize(*args) ⇒ Stylesheet
181
182
183
184
|
# File 'lib/rubyXL/objects/stylesheet.rb', line 181
def initialize(*args)
super
@format_hash = nil
end
|
Class Method Details
.content_type ⇒ Object
190
191
192
|
# File 'lib/rubyXL/objects/stylesheet.rb', line 190
def self.content_type
'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'
end
|
.default ⇒ Object
194
195
196
197
198
199
200
201
|
# File 'lib/rubyXL/objects/stylesheet.rb', line 194
def self.default
self.new(:fonts => RubyXL::Fonts.defaults,
:fills => RubyXL::Fills.defaults,
:borders => RubyXL::Borders.defaults,
:cell_xfs => RubyXL::CellXFs.defaults,
:cell_styles => RubyXL::CellStyles.defaults,
:cell_style_xfs => RubyXL::CellStyleXFs.defaults)
end
|
.xlsx_path ⇒ Object
186
187
188
|
# File 'lib/rubyXL/objects/stylesheet.rb', line 186
def self.xlsx_path
File.join('xl', 'styles.xml')
end
|
Instance Method Details
203
204
205
206
207
208
209
210
211
212
|
# File 'lib/rubyXL/objects/stylesheet.rb', line 203
def get_number_format_by_id(format_id)
@format_hash ||= {}
if @format_hash[format_id].nil? then
@format_hash[format_id] = NumberFormats::DEFAULT_NUMBER_FORMATS.find_by_format_id(format_id) ||
(number_formats && number_formats.find_by_format_id(format_id))
end
@format_hash[format_id]
end
|