<commit_before>module Url2png
  extend self
  
  # modes
  MODES = %w{production placehold dummy}
  
  def config c = {}
    # SET
    #   api_key
    #   private_key
    #   mode        (production[default] placehold dummy)
    #   version     (v6[default])
    
    c.each do |key, value|
      case key
        
      when :api_key   
        @api_key = value
      when :private_key
        @private_key = value
      when :mode
        raise "Url2png error: Invalid mode, only #{ MODES.join(', ') } are allowed" unless MODES.include?(value.to_s)
        @mode = value
      when :api_version
        @api_version = value
      end
    end
  end
  

  # GETTERS
  def api_key
    raise 'Url2png error: No public key defined!' if @api_key.nil?
    @api_key
  end

  def private_key
    raise 'Url2png error: No private key defined!' if @private_key.nil?
    @private_key
  end

  def mode
    @mode ||= 'production' # default: production
  end
  
  def api_version
    @api_version ||= 'v4' #default: v6
  end
  
  def default_size
    @default_size ||= "400x400"
  end
end<commit_msg>default version = v4<commit_after>module Url2png
  extend self
  
  # modes
  MODES = %w{production placehold dummy}
  
  def config c = {}
    # SET
    #   api_key
    #   private_key
    #   mode        (production[default] placehold dummy)
    #   version     (v6[default])
    
    c.each do |key, value|
      case key
        
      when :api_key   
        @api_key = value
      when :private_key
        @private_key = value
      when :mode
        raise "Url2png error: Invalid mode, only #{ MODES.join(', ') } are allowed" unless MODES.include?(value.to_s)
        @mode = value
      when :api_version
        @api_version = value
      end
    end
  end
  

  # GETTERS
  def api_key
    raise 'Url2png error: No public key defined!' if @api_key.nil?
    @api_key
  end

  def private_key
    raise 'Url2png error: No private key defined!' if @private_key.nil?
    @private_key
  end

  def mode
    @mode ||= 'production' # default: production
  end
  
  def api_version
    @api_version ||= 'v4' #default: v4
  end
  
  def default_size
    @default_size ||= "400x400"
  end
end
{'fraction_non_alphanumeric': 0.08932661475034356, 'fraction_numerical': 0.012368300503893724, 'mean_word_length': 2.12, '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': '3998794', 'n_tokens_mistral': 761, 'n_tokens_neox': 742, 'n_words': 209}