Class: RocketFuel::Precheck::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/rocket_fuel/precheck/check.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check_name(sym) ⇒ Object



24
25
26
# File 'lib/rocket_fuel/precheck/check.rb', line 24

def check_name(sym)
  @check_name = sym
end

.check_name_valueObject



28
29
30
# File 'lib/rocket_fuel/precheck/check.rb', line 28

def check_name_value
  @check_name
end

.register!Object



32
33
34
# File 'lib/rocket_fuel/precheck/check.rb', line 32

def register!
  RocketFuel::Precheck.register_check(self)
end

Instance Method Details

#check?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rocket_fuel/precheck/check.rb', line 15

def check?
  true
end

#messageObject



19
20
21
# File 'lib/rocket_fuel/precheck/check.rb', line 19

def message
  ok? ? success_message : failure_message
end

#ok?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/rocket_fuel/precheck/check.rb', line 7

def ok?
  virtual_method(:ok?)
end

#runObject



11
12
13
# File 'lib/rocket_fuel/precheck/check.rb', line 11

def run
  CheckResult.new(ok?, message, self.class.check_name_value)
end