diff options
Diffstat (limited to 'lib/axlsx/package.rb')
| -rw-r--r-- | lib/axlsx/package.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index 26f838f8..34add29b 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -33,7 +33,7 @@ module Axlsx # Shortcut to specify that the workbook should use autowidth # @see Workbook#use_autowidth def use_autowidth=(v) - Axlsx::validate_boolean(v) + Axlsx.validate_boolean(v) workbook.use_autowidth = v end @@ -46,7 +46,7 @@ module Axlsx # Shortcut to specify that the workbook should use shared strings # @see Workbook#use_shared_strings def use_shared_strings=(v) - Axlsx::validate_boolean(v) + Axlsx.validate_boolean(v) workbook.use_shared_strings = v end @@ -101,12 +101,12 @@ module Axlsx # s = p.to_stream() # File.open('example_streamed.xlsx', 'wb') { |f| f.write(s.read) } def serialize(output, options = {}, secondary_options = nil) - if !workbook.styles_applied + unless workbook.styles_applied workbook.apply_styles end confirm_valid, zip_command = parse_serialize_options(options, secondary_options) - return false unless !confirm_valid || self.validate.empty? + return false unless !confirm_valid || validate.empty? zip_provider = if zip_command ZipCommand.new(zip_command) @@ -126,11 +126,11 @@ module Axlsx # @param [Boolean] confirm_valid Validate the package prior to serialization. # @return [StringIO|Boolean] False if confirm_valid and validation errors exist. rewound string IO if not. def to_stream(confirm_valid = false) - if !workbook.styles_applied + unless workbook.styles_applied workbook.apply_styles end - return false unless !confirm_valid || self.validate.empty? + return false unless !confirm_valid || validate.empty? Relationship.initialize_ids_cache stream = BufferedZipOutputStream.write_buffer do |zip| @@ -266,7 +266,7 @@ module Axlsx [ { entry: CONTENT_TYPES_PN, doc: content_types, schema: CONTENT_TYPES_XSD }, { entry: RELS_PN, doc: relationships, schema: RELS_XSD }, - *(parts.sort_by { |part| part[:entry] }.reverse) + *parts.sort_by { |part| part[:entry] }.reverse ] end |
