diff options
| author | Zsolt Kozaroczy <[email protected]> | 2023-04-12 16:55:10 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-12 16:55:10 +0200 |
| commit | 4643fbded250a02191f0e652618ee23fcf26c8b6 (patch) | |
| tree | 1b4fa5d8c85ed10c866b22e0cc7c480ffe7921de /lib/axlsx/drawing/num_data.rb | |
| parent | bad5cac91b653848bffb4fb45326664f9d806ed2 (diff) | |
| parent | c4bd23bdb6b20763027370f7db13cef1ed7d6e75 (diff) | |
| download | caxlsx-4643fbded250a02191f0e652618ee23fcf26c8b6.tar.gz caxlsx-4643fbded250a02191f0e652618ee23fcf26c8b6.zip | |
Merge pull request #191 from tagliala/chore/add-rubocop
Add RuboCop (and fix simple whitespace, magic comment, trailing comma offenses)
Diffstat (limited to 'lib/axlsx/drawing/num_data.rb')
| -rw-r--r-- | lib/axlsx/drawing/num_data.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/axlsx/drawing/num_data.rb b/lib/axlsx/drawing/num_data.rb index 9b7a2587..7239ac5f 100644 --- a/lib/axlsx/drawing/num_data.rb +++ b/lib/axlsx/drawing/num_data.rb @@ -1,16 +1,13 @@ -# -*- coding: utf-8 -*- module Axlsx - - #This class specifies data for a particular data point. It is used for both numCache and numLit object + # This class specifies data for a particular data point. It is used for both numCache and numLit object class NumData - include Axlsx::OptionsParser # creates a new NumVal object # @option options [String] formatCode # @option options [Array] :data # @see StrData - def initialize(options={}) + def initialize(options = {}) @format_code = "General" @pt = SimpleTypedList.new NumVal parse_options options @@ -22,7 +19,7 @@ module Axlsx # Creates the val objects for this data set. I am not overly confident this is going to play nicely with time and data types. # @param [Array] values An array of cells or values. - def data=(values=[]) + def data=(values = []) @tag_name = values.first.is_a?(Cell) ? :numCache : :numLit values.each do |value| value = value.is_formula? ? 0 : value.value if value.is_a?(Cell) @@ -31,7 +28,7 @@ module Axlsx end # @see format_code - def format_code=(v='General') + def format_code=(v = 'General') Axlsx::validate_string(v) @format_code = v end @@ -46,7 +43,5 @@ module Axlsx end str << ('</c:' << @tag_name.to_s << '>') end - end - end |
