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: functions.rb
    path of file: ./repos/ruby-packer/ruby/lib/rexml
    
    the code of the file until where you have to start completion: # frozen_string_literal: false
module REXML
  # If you add a method, keep in mind two
    
    def Functions::number(object=@@context[:node])
      case object
      when true
        Float(1)
      when false
        Float(0)
      when Array
        number(string(object))
      when Numeric
        object.to_f
      else
        str = string(object)
        case str.strip
        when /\A\s*(-?(?:\d+(?:\.\d*)?|\.\d+))\s*\z/
          $1.to_f
        else
          Float::NAN
        end