summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/axlsx.rb')
-rw-r--r--lib/axlsx.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index 931feb2d..df847a18 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -54,7 +54,7 @@ module Axlsx
end
# determines the cell range for the items provided
- def self.cell_range(cells, absolute=true)
+ def self.cell_range(cells, absolute = true)
return "" unless cells.first.is_a? Cell
first_cell, last_cell = cells.minmax_by(&:pos)
@@ -88,7 +88,7 @@ module Axlsx
letters_str = name[/[A-Z]+/]
# capitalization?!?
- v = letters_str.reverse.chars.reduce({:base=>1, :i=>0}) do |val, c|
+ v = letters_str.reverse.chars.reduce({ :base => 1, :i => 0 }) do |val, c|
val[:i] += ((c.bytes.first - 64) * val[:base])
val[:base] *= 26
@@ -123,7 +123,7 @@ module Axlsx
# @example Relative Cell Reference
# ws.rows.first.cells.first.r #=> "A1"
def self.cell_r(c_index, r_index)
- col_ref(c_index) << (r_index+1).to_s
+ col_ref(c_index) << (r_index + 1).to_s
end
# Creates an array of individual cell references based on an excel reference range.
@@ -143,10 +143,10 @@ module Axlsx
# performs the increadible feat of changing snake_case to CamelCase
# @param [String] s The snake case string to camelize
# @return [String]
- def self.camel(s="", all_caps = true)
+ def self.camel(s = "", all_caps = true)
s = s.to_s
s = s.capitalize if all_caps
- s.gsub(/_(.)/){ $1.upcase }
+ s.gsub(/_(.)/) { $1.upcase }
end
# returns the provided string with all invalid control charaters