summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-05-30 20:22:41 +0900
committerRandy Morgan <[email protected]>2012-05-30 20:22:41 +0900
commit3e9026bae0dde81eeeb86ee76ee680b4b8878b86 (patch)
tree2801d2282c6e3f663ecaa307c062b84662d8a8ce /lib
parentf7287c1f421a7e71ae34658adb29b30fefb1afe3 (diff)
downloadcaxlsx-3e9026bae0dde81eeeb86ee76ee680b4b8878b86.tar.gz
caxlsx-3e9026bae0dde81eeeb86ee76ee680b4b8878b86.zip
release prep for 1.1.6
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx.rb3
-rw-r--r--lib/axlsx/version.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/data_validation.rb30
-rw-r--r--lib/axlsx/workbook/worksheet/sheet_protection.rb34
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb8
5 files changed, 39 insertions, 38 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index 7faabf3e..92c58b33 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -84,6 +84,9 @@ module Axlsx
Axlsx::col_ref(c_index).to_s << (r_index+1).to_s
end
+ # 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="")
s = s.capitalize.gsub(/_(.)/){ $1.upcase }
end
diff --git a/lib/axlsx/version.rb b/lib/axlsx/version.rb
index 740038de..44727f85 100644
--- a/lib/axlsx/version.rb
+++ b/lib/axlsx/version.rb
@@ -5,6 +5,6 @@ module Axlsx
# When using bunle exec rake and referencing the gem on github or locally
# it will use the gemspec, which preloads this constant for the gem's version.
# We check to make sure that it has not already been loaded
- VERSION="1.1.5" unless defined? Axlsx::VERSION
+ VERSION="1.1.6" unless defined? Axlsx::VERSION
end
diff --git a/lib/axlsx/workbook/worksheet/data_validation.rb b/lib/axlsx/workbook/worksheet/data_validation.rb
index 8eca9375..e790bc77 100644
--- a/lib/axlsx/workbook/worksheet/data_validation.rb
+++ b/lib/axlsx/workbook/worksheet/data_validation.rb
@@ -13,14 +13,14 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :formula1
# Formula2
# Available for type whole, decimal, date, time, textLength
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :formula2
# Allow Blank
@@ -29,7 +29,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [Boolean]
- # @default true
+ # default true
attr_reader :allowBlank
# Error Message
@@ -37,7 +37,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :error
# Error Style (ST_DataValidationErrorStyle)
@@ -49,7 +49,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [Symbol]
- # @default :stop
+ # default :stop
attr_reader :errorStyle
# Error Title
@@ -57,7 +57,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :errorTitle
# Operator (ST_DataValidationOperator)
@@ -74,7 +74,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength
# @see type
# @return [Symbol]
- # @default nil
+ # default nil
attr_reader :operator
# Input prompt
@@ -82,7 +82,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :prompt
# Prompt title
@@ -90,7 +90,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :promptTitle
# Show drop down
@@ -99,7 +99,7 @@ module Axlsx
# Available for type list
# @see type
# @return [Boolean]
- # @default false
+ # default false
attr_reader :showDropDown
# Show error message
@@ -108,7 +108,7 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [Boolean]
- # @default false
+ # default false
attr_reader :showErrorMessage
# Show input message
@@ -116,14 +116,14 @@ module Axlsx
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [Boolean]
- # @default false
+ # default false
attr_reader :showInputMessage
# Range over which data validation is applied, in "A1:B2" format
# Available for type whole, decimal, date, time, textLength, list, custom
# @see type
# @return [String]
- # @default nil
+ # default nil
attr_reader :sqref
# The type (ST_DataValidationType) of data validation.
@@ -137,7 +137,7 @@ module Axlsx
# * time: Data validation which checks for time values satisfying the given condition.
# * whole: Data validation which checks for whole number values satisfying the given condition.
# @return [Symbol]
- # @default none
+ # default none
attr_reader :type
# Creates a new {DataValidation} object
@@ -242,4 +242,4 @@ module Axlsx
attributes.flatten!
end
end
-end \ No newline at end of file
+end
diff --git a/lib/axlsx/workbook/worksheet/sheet_protection.rb b/lib/axlsx/workbook/worksheet/sheet_protection.rb
index d8855008..104be53b 100644
--- a/lib/axlsx/workbook/worksheet/sheet_protection.rb
+++ b/lib/axlsx/workbook/worksheet/sheet_protection.rb
@@ -7,67 +7,67 @@ module Axlsx
# If 1 or true then AutoFilters should not be allowed to operate when the sheet is protected.
# If 0 or false then AutoFilters should be allowed to operate when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :auto_filter
# If 1 or true then deleting columns should not be allowed when the sheet is protected.
# If 0 or false then deleting columns should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :delete_columns
# If 1 or true then deleting rows should not be allowed when the sheet is protected.
# If 0 or false then deleting rows should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :delete_rows
# If 1 or true then formatting cells should not be allowed when the sheet is protected.
# If 0 or false then formatting cells should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :format_cells
# If 1 or true then formatting columns should not be allowed when the sheet is protected.
# If 0 or false then formatting columns should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :format_columns
# If 1 or true then formatting rows should not be allowed when the sheet is protected.
# If 0 or false then formatting rows should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :format_rows
# If 1 or true then inserting columns should not be allowed when the sheet is protected.
# If 0 or false then inserting columns should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :insert_columns
# If 1 or true then inserting hyperlinks should not be allowed when the sheet is protected.
# If 0 or false then inserting hyperlinks should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :insert_hyperlinks
# If 1 or true then inserting rows should not be allowed when the sheet is protected.
# If 0 or false then inserting rows should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :insert_rows
# If 1 or true then editing of objects should not be allowed when the sheet is protected.
# If 0 or false then objects are allowed to be edited when the sheet is protected.
# @return [Boolean]
- # @default false
+ # default false
attr_reader :objects
# If 1 or true then PivotTables should not be allowed to operate when the sheet is protected.
# If 0 or false then PivotTables should be allowed to operate when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :pivot_tables
# Specifies the salt which was prepended to the user-supplied password before it was hashed using the hashing algorithm
@@ -77,36 +77,36 @@ module Axlsx
# If 1 or true then Scenarios should not be edited when the sheet is protected.
# If 0 or false then Scenarios are allowed to be edited when the sheet is protected.
# @return [Boolean]
- # @default false
+ # default false
attr_reader :scenarios
# If 1 or true then selection of locked cells should not be allowed when the sheet is protected.
# If 0 or false then selection of locked cells should be allowed when the sheet is protected.
# @return [Boolean]
- # @default false
+ # default false
attr_reader :select_locked_cells
# If 1 or true then selection of unlocked cells should not be allowed when the sheet is protected.
# If 0 or false then selection of unlocked cells should be allowed when the sheet is protected.
# @return [Boolean]
- # @default false
+ # default false
attr_reader :select_unlocked_cells
# If 1 or true then the sheet is protected.
# If 0 or false then the sheet is not protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :sheet
# If 1 or true then sorting should not be allowed when the sheet is protected.
# If 0 or false then sorting should be allowed when the sheet is protected.
# @return [Boolean]
- # @default true
+ # default true
attr_reader :sort
# Password hash
# @return [String]
- # @default nil
+ # default nil
attr_reader :password
# Creates a new SheetProtection instance
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 56c17f32..3f73ee19 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -206,11 +206,9 @@ module Axlsx
# Add data validation to this worksheet.
#
- # @param
- # @example
- #
- # @see
- # @see
+ # @param [String] cells The cells the validation will apply to.
+ # @param [hash] data_validation options defining the validation to apply.
+ # @see examples/data_validation.rb for an example
def add_data_validation(cells, data_validation)
dv = DataValidation.new(data_validation)
dv.sqref = cells