diff options
| author | Randy Morgan <[email protected]> | 2012-12-04 09:54:31 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-12-04 09:54:31 +0900 |
| commit | 265f30d9e827d7cfb8721c315c284de52e7395e5 (patch) | |
| tree | 0b0402caeb8962ea565226fe60e68cf0f76d6f67 | |
| parent | 979523372fb05a7c3da574759a13e82a491bf94f (diff) | |
| download | caxlsx-265f30d9e827d7cfb8721c315c284de52e7395e5.tar.gz caxlsx-265f30d9e827d7cfb8721c315c284de52e7395e5.zip | |
Added unsigned_int and float attr_accessor helpers
These need to be added to existing classes to replace all the repeated
accessor method validation.
| -rw-r--r-- | lib/axlsx/util/accessors.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/axlsx/util/accessors.rb b/lib/axlsx/util/accessors.rb index f578be26..a33fdccc 100644 --- a/lib/axlsx/util/accessors.rb +++ b/lib/axlsx/util/accessors.rb @@ -22,6 +22,21 @@ module Axlsx validated_attr_accessor(symbols, 'validate_string') end + + # Creates one or more usigned integer attr_accessors + # @param [Array] symbols An array of symbols representing the + # names of the attributes you will add to your class + def unsigned_int_attr_accessor(*symbols) + validated_attr_accessor(symbols, 'validate_unsigned_int') + end + + # Creates one or more float (double?) attr_accessors + # @param [Array] symbols An array of symbols representing the + # names of the attributes you will add to your class + def float_attr_accessor(*symbols) + validated_attr_accessor(symbols, 'validate_float') + end + # Creates on or more boolean validated attr_accessors # @param [Array] symbols An array of symbols representing the # names of the attributes you will add to your class. |
