Class: Improves::Retire

Inherits:
ImproveHunter show all
Defined in:
app/services/improves/retire.rb

Overview

Used to apply an Improvements::Retire to a hunter if the hunter is a valid target

Instance Method Summary collapse

Methods inherited from ImproveHunter

#check, for, #hunter_not_advanced?, #hunter_playbook_mismatch?, #initialize

Constructor Details

This class inherits a constructor from ImproveHunter

Instance Method Details

#improveObject


9
10
11
12
# File 'app/services/improves/retire.rb', line 9

def improve
  return false unless valid?
  @hunter.retire!
end

#valid?Boolean

Returns:

  • (Boolean)

14
15
16
17
18
19
# File 'app/services/improves/retire.rb', line 14

def valid?
  super
  check :retired?, :hunter,
        'is already retired'
  @hunters_improvement.errors.none?
end