Sha256: 91c9529204df969743304ff69f3fb82685e20b48ccf661f12dbf9ff05abf334c

Contents?: true

Size: 926 Bytes

Versions: 25

Compression:

Stored size: 926 Bytes

Contents

# frozen_string_literal: true

# Rules
class Recruiter
  def score; end

  def position; end

  def assess
    case position
    when 'Manager'
      assess_manager(score)
    when 'Senior Engineer'
      assess_sr_engineer(score)
    when 'Engineer'
      assess_engineer(score)
    end
  end

  private

  # Shortlist score of 9, accept 10, and reject the rest
  def assess_manager(score)
    return 'Shortlist' if score == 9

    return 'Accept' if score == 10

    'Reject'
  end

  # Shortlist score of 8, accept 9 or 10, and reject the rest
  def assess_sr_engineer(score)
    return 'Shortlist' if score == 8

    return 'Accept' if score > 8

    'Reject'
  end

  # Score of 9 and above are overqualified, shortlist 7, accept 8, and reject the rest.
  def assess_engineer(score)
    return 'Over Qualified' if score > 8

    return 'Accept' if score == 8

    return 'Shortlist' if score == 7

    'Reject'
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rast-1.0.0 examples/recruiter.rb
rast-0.19.1 examples/recruiter.rb
rast-0.19.0 examples/recruiter.rb
rast-0.18.0 examples/recruiter.rb
rast-0.15.1 examples/recruiter.rb
rast-0.14.0 examples/recruiter.rb
rast-0.11.4 examples/recruiter.rb
rast-0.11.3 examples/recruiter.rb
rast-0.11.1 examples/recruiter.rb
rast-0.11.0 examples/recruiter.rb
rast-0.10.0 examples/recruiter.rb
rast-0.9.0 examples/recruiter.rb
rast-0.9.0.pre examples/recruiter.rb
rast-0.8.1.pre examples/recruiter.rb
rast-0.8.0.pre examples/recruiter.rb
rast-0.6.2.pre examples/recruiter.rb
rast-0.6.1.pre examples/recruiter.rb
rast-0.6.0.pre examples/recruiter.rb
rast-0.4.2.pre examples/recruiter.rb
rast-0.4.1.pre examples/recruiter.rb