<commit_before>module TreeNode
  module Menu
    class Item < TreeNode::Menu::Node
      set_attribute(:key) { "#{@tree.node_id_prefix}__#{@object.feature}" }
      set_attribute(:text) { _(details[:name]) }
      set_attribute(:tooltip) { _(details[:description]) || _(details[:name]) }
      set_attribute(:selected) { parent_selected? || self_selected? }

      private

      def details
        ::MiqProductFeature.obj_features[@object.feature].try(:[], :feature).try(:details)
      end

      def feature_parent
        ::MiqProductFeature.obj_features[::MiqProductFeature.feature_parent(@object.feature)][:feature]
      end

      def parent_selected?
        @tree.features.include?(feature_parent.identifier)
      end

      def self_selected?
        @tree.features.include?(@object.feature)
      end
    end
  end
end<commit_msg>Clean up the unnecessary methods in TreeNode::Menu::Item<commit_after>module TreeNode
  module Menu
    class Item < TreeNode::Menu::Node
      set_attribute(:key) { "#{@tree.node_id_prefix}__#{@object.feature}" }

      set_attribute(:text, :tooltip) do
        details = ::MiqProductFeature.obj_features[@object.feature].try(:[], :feature).try(:details)
        [_(details[:name]), _(details[:description]) || _(details[:name])]
      end

      set_attribute(:selected) do
        parent_feature = ::MiqProductFeature.obj_features[::MiqProductFeature.feature_parent(@object.feature)][:feature]

        [parent_feature.identifier, @object.feature].any? do |item|
          @tree.features.include?(item)
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13908118313404658, 'fraction_numerical': 0.0, 'mean_word_length': 3.622093023255814, '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': '6596824', 'n_tokens_mistral': 466, 'n_tokens_neox': 463, 'n_words': 76}