Class: God::Conditions::Always

Inherits:
PollCondition show all
Defined in:
lib/god/conditions/always.rb

Instance Attribute Summary collapse

Attributes inherited from PollCondition

#interval

Attributes inherited from God::Condition

#info, #notify, #phase, #transition

Attributes inherited from Behavior

#watch

Instance Method Summary collapse

Methods inherited from PollCondition

#after, #before

Methods inherited from God::Condition

#friendly_name, generate, valid?

Methods inherited from Behavior

#after_restart, #after_start, #after_stop, #before_restart, #before_start, #before_stop, #friendly_name, generate

Methods included from God::Configurable

#base_name, complain, #complain, #friendly_name, #prepare, #reset

Constructor Details

#initializeAlways

Returns a new instance of Always.



7
8
9
# File 'lib/god/conditions/always.rb', line 7

def initialize
  self.info = "always"
end

Instance Attribute Details

#whatObject

Returns the value of attribute what.



5
6
7
# File 'lib/god/conditions/always.rb', line 5

def what
  @what
end

Instance Method Details

#testObject



17
18
19
# File 'lib/god/conditions/always.rb', line 17

def test
  @what
end

#valid?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/god/conditions/always.rb', line 11

def valid?
  valid = true
  valid &= complain("Attribute 'what' must be specified", self) if self.what.nil?
  valid
end