<commit_before>require_relative './border_creator'

module AxlsxStyler
  module Axlsx
    module Worksheet
      # Example:
      #   add_style 'A1:B5', b: true, sz: 14
      def add_style(cell_ref, style)
        item = self[cell_ref]
        cells = item.is_a?(Array) ? item : [item]
        cells.each { |cell| cell.add_style(style) }
      end

      # Examples:
      #   add_border 'B2:F8', [:left, :top]
      #   add_border 'C2:G10', [:top]
      #   add_border 'C2:G10'
      # @TODO: allow to pass in custom border style
      def add_border(cell_ref, edges = :all)
        cells = self[cell_ref]
        BorderCreator.new(self, cells, edges).draw
      end
    end
  end
end
<commit_msg>add multiple styles method on axlsx worksheet<commit_after>require_relative './border_creator'

module AxlsxStyler
  module Axlsx
    module Worksheet
      # Example:
      #   add_style 'A1:B5', b: true, sz: 14
      def add_style(cell_ref, style)
        item = self[cell_ref]
        cells = item.is_a?(Array) ? item : [item]
        cells.each { |cell| cell.add_style(style) }
      end

      # Examples:
      #   add_border 'B2:F8', [:left, :top]
      #   add_border 'C2:G10', [:top]
      #   add_border 'C2:G10'
      # @TODO: allow to pass in custom border style
      def add_border(cell_ref, edges = :all)
        cells = self[cell_ref]
        BorderCreator.new(self, cells, edges).draw
      end

      # Example
        # bold = { b: true }
        # large_text = { sz: 30 }
        # add_multiple_styles 'B2:F8', bold, large_text
      def add_multiple_styles(cell_ref, *styles)
        styles.each { |style| add_style(cell_ref, style) }
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.11355529131985731, 'fraction_numerical': 0.016646848989298454, 'mean_word_length': 2.312992125984252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5813107', 'n_tokens_mistral': 610, 'n_tokens_neox': 594, 'n_words': 143}