<commit_before>module UiBibz::Ui
  class LinkButton < Ui
    include Rails.application.routes.url_helpers

    def initialize content = nil, options = nil, html_options = nil, &block
      @link_button = Component.new content, options, html_options, &block
    end

    def render
      link_to @link_button.render, @link_button.options, class_and_html_options
    end

    def type
      custom = @link_button.html_options[:type] || @link_button.options[:type]
      custom.nil? ? states[:default] : states[custom]
    end

    def class_and_html_options
      @link_button.class_and_html_options(["btn", type])
    end

    def states
      if @states.nil?
        states = {}
        %w(default success primary info waring danger).each do |state|
          states = states.merge(Hash[state.to_sym, "btn-#{ state }"])
        end
        @states = states
      end
      @states
    end

  end
end
<commit_msg>[...work in progress...]<commit_after>module UiBibz::Ui
  class LinkButton < Ui

    def initialize content = nil, options = nil, html_options = nil, &block
      @link_button = Component.new content, options, html_options, &block
    end

    def render
      link_to @link_button.render, @link_button.options, class_and_html_options
    end

    def type
      custom = @link_button.html_options[:type] || @link_button.options[:type]
      custom.nil? ? states[:default] : states[custom]
    end

    def class_and_html_options
      @link_button.class_and_html_options(["btn", type])
    end

    def states
      if @states.nil?
        states = {}
        %w(default success primary info waring danger).each do |state|
          states = states.merge(Hash[state.to_sym, "btn-#{ state }"])
        end
        @states = states
      end
      @states
    end

  end
end

{'fraction_non_alphanumeric': 0.10246360582306831, 'fraction_numerical': 0.0, 'mean_word_length': 2.6921487603305785, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4095998', 'n_tokens_mistral': 559, 'n_tokens_neox': 546, 'n_words': 138}