class Linter::MindsetAssociation
Constants
- FULL_WORD
- USE_FOR_JOB_ADS
Public Class Methods
add_recommendation(result)
click to toggle source
# File lib/linter/mindset_association.rb, line 28 def self.add_recommendation(result) recommendation_file.find { |rec| rec['type'] == 'mindset' }&.dig('trends')&.find { |trend| trend['result'] == result.trend }&.dig('recommendation') end
calculate_trend(result)
click to toggle source
# File lib/linter/mindset_association.rb, line 13 def self.calculate_trend(result) case result.growth_coded_word_counts.values.sum - result.fixed_coded_word_counts.values.sum when 0 'neutral' when 1..3 'growth-coded' when 3..Float::INFINITY 'strongly growth-coded' when -Float::INFINITY..-3 'strongly fixed-coded' else 'fixed-coded' end end
wordlists()
click to toggle source
# File lib/linter/mindset_association.rb, line 8 def self.wordlists file_path = File.join(__dir__, '../../data/mindset_wordlist.yml') @wordlists ||= YAML.load_file(file_path) end