diff options
| author | Randy Morgan <[email protected]> | 2012-07-14 13:06:32 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-07-14 13:06:32 +0900 |
| commit | b24833c496e84177ef1f20ea04abdfa3bc26d51c (patch) | |
| tree | 50c9a2ddea474958754545762888525cfb72bf16 /lib | |
| parent | fb86d1f56f1ecd683417f1a1cbe2a00faa2904ad (diff) | |
| download | caxlsx-b24833c496e84177ef1f20ea04abdfa3bc26d51c.tar.gz caxlsx-b24833c496e84177ef1f20ea04abdfa3bc26d51c.zip | |
1.1.8 release prep
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/drawing/num_data_source.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/drawing/two_cell_anchor.rb | 11 | ||||
| -rw-r--r-- | lib/axlsx/drawing/vml_drawing.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/rels/relationship.rb | 6 | ||||
| -rw-r--r-- | lib/axlsx/util/simple_typed_list.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/util/validators.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/data_bar.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/protected_range.rb | 8 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/worksheet.rb | 25 |
10 files changed, 33 insertions, 31 deletions
diff --git a/lib/axlsx/drawing/num_data_source.rb b/lib/axlsx/drawing/num_data_source.rb index b06fdf91..63f0d811 100644 --- a/lib/axlsx/drawing/num_data_source.rb +++ b/lib/axlsx/drawing/num_data_source.rb @@ -36,7 +36,7 @@ module Axlsx end # sets the tag name for this data source - # @param [Symbol] One of the allowed_tag_names + # @param [Symbol] v One of the allowed_tag_names def tag_name=(v) Axlsx::RestrictionValidator.validate "#{self.class.name}.tag_name", self.class.allowed_tag_names, v @tag_name = v diff --git a/lib/axlsx/drawing/two_cell_anchor.rb b/lib/axlsx/drawing/two_cell_anchor.rb index 8071515c..73ccf2b5 100644 --- a/lib/axlsx/drawing/two_cell_anchor.rb +++ b/lib/axlsx/drawing/two_cell_anchor.rb @@ -26,16 +26,11 @@ module Axlsx attr_reader :drawing - # Creates a new TwoCellAnchor object and sets up a reference to the from and to markers in the - # graphic_frame's chart. That means that you can do stuff like - # c = worksheet.add_chart Axlsx::Chart + # Creates a new TwoCellAnchor object # c.start_at 5, 9 - # @note the chart_type parameter will be replaced with object in v. 2.0.0 # @param [Drawing] drawing - # @param [Class] chart_type This is passed to the graphic frame for instantiation. must be Chart or a subclass of Chart - # @param object The object this anchor holds. - # @option options [Array] start_at the col, row to start at THIS IS DOCUMENTED BUT NOT IMPLEMENTED HERE! - # @option options [Array] end_at the col, row to end at + # @option options [Array] :start_at the col, row to start at THIS IS DOCUMENTED BUT NOT IMPLEMENTED HERE! + # @option options [Array] :end_at the col, row to end at def initialize(drawing, options={}) @drawing = drawing drawing.anchors << self diff --git a/lib/axlsx/drawing/vml_drawing.rb b/lib/axlsx/drawing/vml_drawing.rb index c8ea68a6..39358a6c 100644 --- a/lib/axlsx/drawing/vml_drawing.rb +++ b/lib/axlsx/drawing/vml_drawing.rb @@ -4,7 +4,7 @@ module Axlsx class VmlDrawing # creates a new Vml Drawing object. - # @param [Comments] the comments object this drawing is associated with + # @param [Comments] comments the comments object this drawing is associated with def initialize(comments) raise ArgumentError, "you must provide a comments object" unless comments.is_a?(Comments) @comments = comments diff --git a/lib/axlsx/rels/relationship.rb b/lib/axlsx/rels/relationship.rb index 89a09ce1..99c8e112 100644 --- a/lib/axlsx/rels/relationship.rb +++ b/lib/axlsx/rels/relationship.rb @@ -30,9 +30,9 @@ module Axlsx attr_reader :TargetMode # creates a new relationship - # @param [String] Type The type of the relationship - # @param [String] Target The target for the relationship - # @option [Symbol] target_mode only accepts :external. + # @param [String] type The type of the relationship + # @param [String] target The target for the relationship + # @option [Symbol] :target_mode only accepts :external. def initialize(type, target, options={}) self.Target=target self.Type=type diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb index e3516398..711b4dae 100644 --- a/lib/axlsx/util/simple_typed_list.rb +++ b/lib/axlsx/util/simple_typed_list.rb @@ -18,7 +18,7 @@ module Axlsx # Creats a new typed list # @param [Array, Class] type An array of Class objects or a single Class object - # @param [String] serialize The tag name to use in serialization + # @param [String] serialize_as The tag name to use in serialization # @raise [ArgumentError] if all members of type are not Class objects def initialize type, serialize_as=nil if type.is_a? Array diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index 0f4f0dce..f168bb5e 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -181,7 +181,7 @@ module Axlsx # Requires that the value is a valid scatterStyle # must be one of :none | :line | :lineMarker | :marker | :smooth | :smoothMarker # must be one of "none" | "line" | "lineMarker" | "marker" | "smooth" | "smoothMarker" - # @param [Symbol|String] the value to validate + # @param [Symbol|String] v the value to validate def self.validate_scatter_style(v) Axlsx::RestrictionValidator.validate "ScatterChart.scatterStyle", [:none, :line, :lineMarker, :marker, :smooth, :smoothMarker], v.to_sym end @@ -262,4 +262,4 @@ module Axlsx def self.validate_split_state_type(v) RestrictionValidator.validate :split_state_type, [:frozen, :frozen_split, :split], v end -end
\ No newline at end of file +end diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 4453529b..407aef4d 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -142,7 +142,7 @@ module Axlsx # The inline color property for the cell # @return [Color] attr_reader :color - # @param [String] The 8 character representation for an rgb color #FFFFFFFF" + # @param [String] v The 8 character representation for an rgb color #FFFFFFFF" def color=(v) @color = v.is_a?(Color) ? v : Color.new(:rgb=>v) @is_text_run = true diff --git a/lib/axlsx/workbook/worksheet/data_bar.rb b/lib/axlsx/workbook/worksheet/data_bar.rb index c5054876..66a02adf 100644 --- a/lib/axlsx/workbook/worksheet/data_bar.rb +++ b/lib/axlsx/workbook/worksheet/data_bar.rb @@ -65,7 +65,7 @@ module Axlsx def showValue=(v); Axlsx.validate_boolean(v); @showValue = v end # Sets the color for the data bars. - # @param [Color|String] The color object, or rgb string value to apply + # @param [Color|String] v The color object, or rgb string value to apply def color=(v) @color = v if v.is_a? Color self.color.rgb = v if v.is_a? String diff --git a/lib/axlsx/workbook/worksheet/protected_range.rb b/lib/axlsx/workbook/worksheet/protected_range.rb index feb5eb48..5917ad6e 100644 --- a/lib/axlsx/workbook/worksheet/protected_range.rb +++ b/lib/axlsx/workbook/worksheet/protected_range.rb @@ -21,17 +21,23 @@ module Axlsx end yield self if block_given? end - + + # @see sqref def sqref=(v) Axlsx.validate_string(v) @sqref = v end + # @see name def name=(v) Axlsx.validate_string(v) @name = v end + # serializes the proteted range + # @param [String] str if this string object is provided we append + # our output to that object. Use this - it helps limit the number of + # objects created during serialization def to_xml_string(str="") attrs = self.instance_values.reject{ |key, value| value == nil } str << '<protectedRange ' << attrs.map { |key, value| '' << key << '="' << value.to_s << '"' }.join(' ') << '/>' diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 9c87be15..93eb010b 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -245,7 +245,7 @@ module Axlsx # worksheet.merge_cells worksheet.rows.first.cells[(2..4)] # #alternatively you can do it from a single cell # worksheet["C1"].merge worksheet["E1"] - # @param [Array, string] + # @param [Array, string] cells def merge_cells(cells) @merged_cells << if cells.is_a?(String) cells @@ -256,8 +256,8 @@ module Axlsx end # Adds a new protected cell range to the worksheet. Note that protected ranges are only in effect when sheet protection is enabled. - # @param [String|Array] The string reference for the cells to protect or an array of cells. - # @retrun [ProtectedRange] + # @param [String|Array] cells The string reference for the cells to protect or an array of cells. + # @return [ProtectedRange] # @note When using an array of cells, a contiguous range is created from the minimum top left to the maximum top bottom of the cells provided. def protect_range(cells) sqref = if cells.is_a?(String) @@ -425,8 +425,9 @@ module Axlsx # Set the style for cells in a specific row # @param [Integer] index or range of indexes in the table - # @param [Integer] the cellXfs index - # @option options [Integer] col_offset only cells after this column will be updated. + # @param [Integer] style the cellXfs index + # @param [Hash] options the options used when applying the style + # @option [Integer] :col_offset only cells after this column will be updated. # @note You can also specify the style in the add_row call # @see Worksheet#add_row # @see README.md for an example @@ -448,8 +449,9 @@ module Axlsx # Set the style for cells in a specific column # @param [Integer] index the index of the column - # @param [Integer] the cellXfs index - # @option options [Integer] row_offset only cells after this column will be updated. + # @param [Integer] style the cellXfs index + # @param [Hash] options + # @option [Integer] :row_offset only cells after this column will be updated. # @note You can also specify the style for specific columns in the call to add_row by using an array for the :styles option # @see Worksheet#add_row # @see README.md for an example @@ -472,9 +474,9 @@ module Axlsx # @example This would set the first and third column widhts but leave the second column in autofit state. # ws.column_widths 7.2, nil, 3 # @note For updating only a single column it is probably easier to just set the width of the ws.column_info[col_index].width directly - # @param [Integer|Float|Fixnum|nil] values - def column_widths(*args) - args.each_with_index do |value, index| + # @param [Integer|Float|Fixnum|nil] widths + def column_widths(*widths) + widths.each_with_index do |value, index| next if value == nil Axlsx::validate_unsigned_numeric(value) unless value == nil @column_info[index] ||= Col.new index+1, index+1 @@ -516,8 +518,7 @@ module Axlsx end # Adds a media item to the worksheets drawing - # @param [Class] media_type - # @option options [] unknown + # @option [Hash] options options passed to drawing.add_image def add_image(options={}) image = drawing.add_image(options) yield image if block_given? |
