aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/excelx/cell.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
commitdddfa903d2b856146f05ffb4415c31d6127bb5bf (patch)
treee38c2aca92b54f06ccd0185f48dc47e3e1b3d77e /lib/roo/excelx/cell.rb
parent8280a21a23d44aa90177e2bc041d0b8dc8556f4b (diff)
New upstream version 2.8.0upstream/2.8.0
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