aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/excelx/cell.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:41:26 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:41:26 -0500
commit6aa7e04e06423e7d92ede727489ea346e88f7108 (patch)
tree9bdec92fd17898b662235bc0a491de827990130c /lib/roo/excelx/cell.rb
parentc59817e300dbe1aab3120cad603cdb14b14ed78b (diff)
parentdddfa903d2b856146f05ffb4415c31d6127bb5bf (diff)
Update upstream source from tag 'upstream/2.8.0'
Update to upstream version '2.8.0' with Debian dir 569f5866fbcf4e449c6c48dc5d20a3ab54f95252
Diffstat (limited to 'lib/roo/excelx/cell.rb')
-rw-r--r--lib/roo/excelx/cell.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/roo/excelx/cell.rb b/lib/roo/excelx/cell.rb
index 2fc78e1..7abd074 100644
--- a/lib/roo/excelx/cell.rb
+++ b/lib/roo/excelx/cell.rb
@@ -40,19 +40,23 @@ module Roo
end
def self.create_cell(type, *values)
+ cell_class(type)&.new(*values)
+ end
+
+ def self.cell_class(type)
case type
when :string
- Cell::String.new(*values)
+ Cell::String
when :boolean
- Cell::Boolean.new(*values)
+ Cell::Boolean
when :number
- Cell::Number.new(*values)
+ Cell::Number
when :date
- Cell::Date.new(*values)
+ Cell::Date
when :datetime
- Cell::DateTime.new(*values)
+ Cell::DateTime
when :time
- Cell::Time.new(*values)
+ Cell::Time
end
end