<commit_before>require 'uri'
require 'json'
require 'nacre/order_search_results'
require 'nacre/concerns/inflectible'

module Nacre

  class Order

    extend Inflectible

    attr_reader :id, :parent_order_id

    def initialize(options = {})
      @id = if blank?(options[:id].to_s)
              options[:order_id].to_s
            else
              options[:id].to_s
            end
      @parent_order_id = options[:parent_order_id].to_s
    end

    def self.find(id_list = [])
      response = link.get(self.search_url)
      Nacre::OrderSearchResults.from_json(response.body)
    end

    def self.from_json(json)
      params = orders_from_json(json)
      new(params)
    end

    private

    def blank?(value)
      value.nil? || matches?(value,'\s*')
    end

    def matches?(value,subexpression)<commit_msg>Remove Infectible from Order since it's not used<commit_after>require 'uri'
require 'json'
require 'nacre/order_search_results'

module Nacre

  class Order


    attr_reader :id, :parent_order_id

    def initialize(options = {})
      @id = if blank?(options[:id].to_s)
              options[:order_id].to_s
            else
              options[:id].to_s
            end
      @parent_order_id = options[:parent_order_id].to_s
    end

    def self.find(id_list = [])
      response = link.get(self.search_url)
      Nacre::OrderSearchResults.from_json(response.body)
    end

    def self.from_json(json)
      params = orders_from_json(json)
      new(params)
    end

    private

    def blank?(value)
      value.nil? || matches?(value,'\s*')
    end

    def matches?(value,subexpression)
{'fraction_non_alphanumeric': 0.107958050586058, 'fraction_numerical': 0.0, 'mean_word_length': 2.6044444444444443, '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': '2712408', 'n_tokens_mistral': 534, 'n_tokens_neox': 522, 'n_words': 100}