<commit_before>require "data/state_pension_date_query"

module SmartAnswer::Calculators
  class StatePensionAgeCalculator
    include FriendlyTimeDiff

    attr_reader :gender, :dob, :qualifying_years, :available_years , :starting_credits, :pays_reduced_ni_rate
    attr_accessor :qualifying_years

    NEW_RULES_START_DATE = Date.parse('6 April 2016')

    def initialize(answers)
      @gender = answers[:gender].to_sym
      @dob = answers[:dob]
      @qualifying_years = answers.fetch(:qualifying_years, 0)
      @available_years = ni_years_to_date_from_dob
      @starting_credits = allocate_starting_credits
      @pays_reduced_ni_rate = answers[:pays_reduced_ni_rate]
    end

    def new_rules_and_less_than_10_ni? ni
      (ni < 10) && (state_pension_date >= NEW_RULES_START_DATE)
    end

    def automatic_ni_age_group?
      (Date.parse('1959-04-06')..Date.parse('1992-04-05')).cover?(dob)
    end

    def woman_born_in_married_stamp_era?<commit_msg>Remove unused calculator method<commit_after>require "data/state_pension_date_query"

module SmartAnswer::Calculators
  class StatePensionAgeCalculator
    include FriendlyTimeDiff

    attr_reader :gender, :dob, :qualifying_years, :available_years , :starting_credits, :pays_reduced_ni_rate
    attr_accessor :qualifying_years

    NEW_RULES_START_DATE = Date.parse('6 April 2016')

    def initialize(answers)
      @gender = answers[:gender].to_sym
      @dob = answers[:dob]
      @qualifying_years = answers.fetch(:qualifying_years, 0)
      @available_years = ni_years_to_date_from_dob
      @starting_credits = allocate_starting_credits
      @pays_reduced_ni_rate = answers[:pays_reduced_ni_rate]
    end

    def automatic_ni_age_group?
      (Date.parse('1959-04-06')..Date.parse('1992-04-05')).cover?(dob)
    end

    def woman_born_in_married_stamp_era?
{'fraction_non_alphanumeric': 0.09185347184253691, 'fraction_numerical': 0.026243849097867686, 'mean_word_length': 4.579268292682927, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3870219', 'n_tokens_mistral': 698, 'n_tokens_neox': 620, 'n_words': 96}