diff options
| author | Randy Morgan <[email protected]> | 2011-11-26 13:20:57 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-26 13:20:57 +0900 |
| commit | 11303a4d6664d9a7ff7bc408035d2ab70378a375 (patch) | |
| tree | 51c675ae3ab8cd6c1afd7087145261b1eb2ec54c /lib/axlsx/drawing/scaling.rb | |
| parent | 044afe5a35db42cefce4f18a0fecc3da90cab1b5 (diff) | |
| download | caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.tar.gz caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.zip | |
adding in support for ruby 1.9.3
release version 1.0.9
Diffstat (limited to 'lib/axlsx/drawing/scaling.rb')
| -rw-r--r-- | lib/axlsx/drawing/scaling.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/axlsx/drawing/scaling.rb b/lib/axlsx/drawing/scaling.rb index c0665463..e89d00f1 100644 --- a/lib/axlsx/drawing/scaling.rb +++ b/lib/axlsx/drawing/scaling.rb @@ -5,20 +5,20 @@ module Axlsx # logarithmic base for a logarithmic axis. # must be between 2 and 1000 # @return [Integer] - attr_accessor :logBase + attr_reader :logBase # the orientation of the axis # must be one of [:minMax, :maxMin] # @return [Symbol] - attr_accessor :orientation + attr_reader :orientation # the maximum scaling # @return [Float] - attr_accessor :max + attr_reader :max # the minimu scaling # @return [Float] - attr_accessor :min + attr_reader :min # creates a new Scaling object # @option options [Integer, Fixnum] logBase @@ -27,14 +27,20 @@ module Axlsx # @option options [Float] min def initialize(options={}) @orientation = :minMax + @logBase, @min, @max = nil, nil, nil options.each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end - def logBase=(v) DataTypeValidator.validate "Scaling.logBase", [Integer, Fixnum], v, lambda { |v| v >= 2 && v <= 1000}; @logBase = v; end + # @see logBase + def logBase=(v) DataTypeValidator.validate "Scaling.logBase", [Integer, Fixnum], v, lambda { |arg| arg >= 2 && arg <= 1000}; @logBase = v; end + # @see orientation def orientation=(v) RestrictionValidator.validate "Scaling.orientation", [:minMax, :maxMin], v; @orientation = v; end + # @see max def max=(v) DataTypeValidator.validate "Scaling.max", Float, v; @max = v; end + + # @see min def min=(v) DataTypeValidator.validate "Scaling.min", Float, v; @min = v; end # Serializes the axId |
