diff options
| author | Jurriaan Pruis <[email protected]> | 2014-01-15 23:44:02 +0100 |
|---|---|---|
| committer | Jurriaan Pruis <[email protected]> | 2014-02-26 20:09:21 +0100 |
| commit | be8e00332c73439cf17083173ea74f1505100df9 (patch) | |
| tree | 383ec2e23fc0a14aa5ad90e139648a79814eeded /lib/axlsx/util/storage.rb | |
| parent | a271a7d0f26ecb26d01aad00e094744d6fe8b0d2 (diff) | |
| download | caxlsx-be8e00332c73439cf17083173ea74f1505100df9.tar.gz caxlsx-be8e00332c73439cf17083173ea74f1505100df9.zip | |
Huge refactoring
Do not create huge strings
Let Row inherit from SimpleTypedList
Optimized sanitizing
Optimized validation
And more..
Diffstat (limited to 'lib/axlsx/util/storage.rb')
| -rw-r--r-- | lib/axlsx/util/storage.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/axlsx/util/storage.rb b/lib/axlsx/util/storage.rb index 9f8afb7f..40cd4a45 100644 --- a/lib/axlsx/util/storage.rb +++ b/lib/axlsx/util/storage.rb @@ -6,14 +6,14 @@ module Axlsx # Packing for the Storage when pushing an array of items into a byte stream # Name, name length, type, color, left sibling, right sibling, child, classid, state, created, modified, sector, size - PACKING = "s32 s1 c2 l3 x16 x4 q2 l q" + PACKING = "s32 s1 c2 l3 x16 x4 q2 l q".freeze # storage types TYPES = { :root=>5, :stream=>2, :storage=>1 - } + }.freeze # Creates a byte string for this storage # @return [String] @@ -45,7 +45,7 @@ module Axlsx # Sets the color for this storage # @param [Integer] v Must be one of the COLORS constant hash values def color=(v) - RestrictionValidator.validate "Storage.color", COLORS.values, v + RestrictionValidator.validate :storage_color, COLORS.values, v @color = v end @@ -116,7 +116,7 @@ module Axlsx # Sets the type for this storage. # @param [Integer] v the type to specify must be one of the TYPES constant hash values. def type=(v) - RestrictionValidator.validate "Storage.type", TYPES.values, v + RestrictionValidator.validate :storage_type, TYPES.values, v @type = v end |
