Permalink
Browse files

update syntax to be compatible with ruby 1.8 and 1.9

  • Loading branch information...
1 parent bacd845 commit 117e2f227673f8a6a2283b940f15e6c7e3f085d8 @yob committed Aug 5, 2011
Showing with 12 additions and 12 deletions.
  1. +2 −2 lib/poi/workbook/area.rb
  2. +10 −10 lib/poi/workbook/cell.rb
View
@@ -7,7 +7,7 @@ def initialize reference
def in workbook
if single_cell_reference?
ref = area.all_referenced_cells.first
- return [workbook.single_cell ref]
+ return [workbook.single_cell, ref]
end
begin
@@ -78,4 +78,4 @@ def new_area_reference
end
end
end
-end
+end
View
@@ -128,11 +128,11 @@ def value_of(cell_value)
return nil if cell_value.nil?
case cell_value.cell_type
- when CELL_TYPE_BLANK: nil
- when CELL_TYPE_BOOLEAN: cell_value.boolean_value
- when CELL_TYPE_ERROR: error_value_from(cell_value.error_value)
- when CELL_TYPE_NUMERIC: numeric_value_from(cell_value)
- when CELL_TYPE_STRING: cell_value.string_value
+ when CELL_TYPE_BLANK then nil
+ when CELL_TYPE_BOOLEAN then cell_value.boolean_value
+ when CELL_TYPE_ERROR then error_value_from(cell_value.error_value)
+ when CELL_TYPE_NUMERIC then numeric_value_from(cell_value)
+ when CELL_TYPE_STRING then cell_value.string_value
else
raise "unhandled cell type[#{cell_value.cell_type}]"
end
@@ -142,11 +142,11 @@ def cell_value_for_type(cell_type)
return nil if cell_type.nil?
begin
case cell_type
- when CELL_TYPE_BLANK: nil
- when CELL_TYPE_BOOLEAN: CELL_VALUE.value_of(poi_cell.boolean_cell_value)
- when CELL_TYPE_FORMULA: cell_value_for_type(poi_cell.cached_formula_result_type)
- when CELL_TYPE_STRING: CELL_VALUE.new(poi_cell.string_cell_value)
- when CELL_TYPE_ERROR, CELL_TYPE_NUMERIC: CELL_VALUE.new(poi_cell.numeric_cell_value)
+ when CELL_TYPE_BLANK then nil
+ when CELL_TYPE_BOOLEAN then CELL_VALUE.value_of(poi_cell.boolean_cell_value)
+ when CELL_TYPE_FORMULA then cell_value_for_type(poi_cell.cached_formula_result_type)
+ when CELL_TYPE_STRING then CELL_VALUE.new(poi_cell.string_cell_value)
+ when CELL_TYPE_ERROR, CELL_TYPE_NUMERIC then CELL_VALUE.new(poi_cell.numeric_cell_value)
else
raise "unhandled cell type[#{poi_cell.cell_type}]"
end

0 comments on commit 117e2f2

Please sign in to comment.