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

module Nanoc
  module Core
    class Pattern
      include Nanoc::Core::ContractsSupport

      contract C::Any => self
      def self.from(obj)
        case obj
        when Nanoc::Core::StringPattern, Nanoc::Core::RegexpPattern
          obj
 
    
      def self.from(obj)
        case obj
        when Nanoc::Core::StringPattern, Nanoc::Core::RegexpPattern
          obj
        when String
          Nanoc::Core::StringPattern.new(obj)
        when Regexp
          Nanoc::Core::RegexpPattern.new(obj)
        when Symbol
          Nanoc::Core::StringPattern.new(obj.to_s)
        else
          raise ArgumentError, "Do not know how to convert `#{obj.inspect}` into a Nanoc::Pattern"
        end