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: flexible.rb
    path of file: ./repos/nii/nii-core/lib/nii/formats/messages
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Nii::Formats::Messages
  # A general message format implementation with the following compatibility:
  # * Full superset of Ruby I18n interpolation syntax.
  # * Full superset of ARB interpolation syntax.
  # * Almost full superset of ICU syntax
    
    def compile_element(node)
      case node
      in String | Numeric            then Nii::Template::Element.new(bundle, node)
      in Symbol                      then Nii::Template::Variable.new(bundle, node)
      in [Symbol | String | Numeric] then compile_element(node.first)
      in [element, Symbol, *args]
        options = args.shift if args.first.is_a? Hash
        method  = :"icu_#{mode}"
        element = compile_element(element)
        raise Nii::Errors::CompileError, "unsupported ICU formatter: #{mode}" unless respond_to? method
        public_send(method, element, *args, **options)
      end