You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cell.rb
    path of file: ./repos/caxlsx/lib/axlsx/workbook/worksheet
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Axlsx
  # A cell in a worksheet.
  # Cell stores inforamation requried to serialize a single worksheet cell to xml. You must provde the Row that the cell belongs to and the cells value. The data type will automatically be determed if you do not specify the :type option. The default style will be applied if you do not supply the :style option. Changing the cell's type will recast the value to the type specified. Altering the cell's value via the property accessor will also automatically cast the provided value to the c
    
    def initialize(row, value = nil, options = {})
      @row = row
      # Do not use instance vars if not needed to use less RAM
      # And do not call parse_options on frequently used options
      # to get less GC cycles
      type = options.delete(:type) || cell_type_from_value(value)
      self.type = type unless type == :string

      val = options.delete(:style)
      self.style = val unless val.nil? || val.zero?
      val = options.delete(:formula_value)
      self.formula_value = val unless val.nil?
      val = options.delete(:escape_formulas)
      self.escape_formulas = val unless val.nil?

      parse_options(options) unless options.empty?

      self.value = value
      value.cell = self if contains_rich_text?
    end

    # this is the cached value for formula cells. If you want the values to render in iOS/Mac OSX preview
    # you need to set this.
    attr_accessor :formula_value

    # An array of available inline styes.
    # TODO change this to a hash where each key defines attr name and validator (and any info the validator requires)
    # then move it out to a module so we can re-use in in other classes.
    # needs to define bla=(v) and bla methods on the class that hook into a
    # set_attr method that kicks the suplied validator and updates the instance_variable
    # for the key
    INLINE_STYLES = [:value, :type, :font_name, :charset,
                     :family, :b, :i, :strike, :outline,
                     :shadow, :condense, :extend, :u,
                     :vertAlign, :sz, :color, :scheme].freeze

    # An array of valid cell types
    CELL_TYPES = [:date, :time, :float, :integer, :richtext,
                  :string, :boolean, :iso_8601, :text].freeze

    # A regular expression to match the alpha(column)numeric(row) reference of a cell
    CELL_REFERENCE_REGEX = /([A-Z]+)([0-9]+)/.freeze

    # The index of the cellXfs item to be applied to this cell.
    # @return [Integer]
    # @see Axlsx::Styles
    def style
      defined?(@style) ? @style : 0
    end

    # Internal
    def style_str
      defined?(@style) ? @style.to_s : '0'
    end

    attr_accessor :raw_style

    # The index of the cellXfs item to be applied to this cell.
    # @param [Hash] style
    # @see Axlsx::Styles
    def add_style(style)
      self.raw_style ||= {}

      new_style = Axlsx.hash_deep_merge(raw_style, style)

      all_edges = [:top, :right, :bottom, :left]

      if !raw_style[:border].nil? && !style[:border].nil?
        border_at = (raw_style[:border][:edges] || all_edges) + (style[:border][:edges] || all_edges)
        new_style[:border][:edges] = border_at.uniq.sort
      elsif !style[:border].nil?
        new_style[:border] = style[:border]
      end

      self.raw_style = new_style

      wb = row.worksheet.workbook

      wb.styled_cells << self
    end