<commit_before>module Imgix
  class Attachment
    attr_reader :name, :instance, :options

    def initialize(name, instance, params = {})
      @params   = self.class.default_options.merge(params)
      @name     = name.present? ? name : @params[:default]
      @instance = instance
    end

    def url(style = nil)
      base_url      = "#{Imgix.options[:protocol]}://#{@instance.options[:subdomain]}.#{Imgix.options[:base_url]}"

      full_url      = [base_url, @instance.options[:prefix], file_name].compact.join("/")

      if style.present? && @params[:styles].include?(style.to_sym)
        [full_url, styles[style.to_sym].to_s].join("?")
      else
        full_url
      end
    end

    def file_name
      @instance.send("#{@name}_file_name")
    end

    def content_type
      @instance.send("#{@name}_content_type")
    end
<commit_msg>removed .present? check on the name in favor of nil? || empty?<commit_after>module Imgix
  class Attachment
    attr_reader :name, :instance, :options

    def initialize(name, instance, params = {})
      @params   = self.class.default_options.merge(params)
      @name     = (name.nil? || name.empty?) ? name : @params[:default]
      @instance = instance
    end

    def url(style = nil)
      base_url = "#{Imgix.options[:protocol]}://#{@instance.options[:subdomain]}.#{Imgix.options[:base_url]}"

      full_url = [base_url, @instance.options[:prefix], file_name].compact.join("/")

      if style.present? && @params[:styles].include?(style.to_sym)
        [full_url, styles[style.to_sym].to_s].join("?")
      else
        full_url
      end
    end

    def file_name
      @instance.send("#{@name}_file_name")
    end

    def content_type
      @instance.send("#{@name}_content_type")
    end

{'fraction_non_alphanumeric': 0.15375854214123008, 'fraction_numerical': 0.0, 'mean_word_length': 3.0114155251141552, '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': '320328', 'n_tokens_mistral': 572, 'n_tokens_neox': 566, 'n_words': 105}