diff options
| author | Randy Morgan <[email protected]> | 2012-02-13 09:59:53 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-02-13 09:59:53 +0900 |
| commit | 2ac78880248f5d88cc8ebe5670f72c481f0f8108 (patch) | |
| tree | 842180ad8d302579d2a34a64dfcf4eaaa890dca9 | |
| parent | 69792d30265868c21d7c9fffa33b4dbcbcfd284a (diff) | |
| download | caxlsx-2ac78880248f5d88cc8ebe5670f72c481f0f8108.tar.gz caxlsx-2ac78880248f5d88cc8ebe5670f72c481f0f8108.zip | |
readability improvement prior to 1.8.7 debugging
| -rw-r--r-- | lib/axlsx.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb index 0859f93b..50f9dfa5 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -33,10 +33,13 @@ require 'bigdecimal' require 'time' #if object does not have this already, I am borrowing it from active_support. - +# I am a very big fan of activesupports instance_values method, but do not want to require nor include the entire +# library just for this one method. +if !Object.respond_to?(:instance_values) Object.send :define_method, :instance_values do Hash[instance_variables.map { |name| [name.to_s[1..-1], instance_variable_get(name)] }] - end unless Object.respond_to?(:instance_values) + end +end # xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine. |
