<commit_before>module Propeller
  module Configuration
    class Setting
      attr_accessor :option
      attr_accessor :value

      def initialize(value_hash)
        @option = value_hash[:option]
        @value  = value_hash[:value]
      end

      def to_s
        "[#{@option.name}] => #{@value}"
      end
    end<commit_msg>Adds json and yaml output for a single Setting.<commit_after>module Propeller
  module Configuration
    class Setting
      require 'json'

      attr_accessor :option
      attr_accessor :value

      def initialize(value_hash)
        @option = value_hash[:option]
        @value  = value_hash[:value]
      end

      def to_yaml
        "#{@option.name.to_json}: #{@value.to_json}"
      end

      def to_json
        "#{@option.name.to_json}: #{@value.to_json}"
      end

      def to_s
        to_yaml
      end
    end
{'fraction_non_alphanumeric': 0.09291521486643438, 'fraction_numerical': 0.0, 'mean_word_length': 2.1691176470588234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '657128', 'n_tokens_mistral': 267, 'n_tokens_neox': 261, 'n_words': 64}