Class: Chef::Resource::ConditionalActionNotNothing

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/resource/conditional_action_not_nothing.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_action) ⇒ ConditionalActionNotNothing

Returns a new instance of ConditionalActionNotNothing.



25
26
27
# File 'lib/chef/resource/conditional_action_not_nothing.rb', line 25

def initialize(current_action)
  @current_action = current_action
end

Instance Attribute Details

#current_actionObject (readonly)

Returns the value of attribute current_action.



23
24
25
# File 'lib/chef/resource/conditional_action_not_nothing.rb', line 23

def current_action
  @current_action
end

Instance Method Details

#continue?Boolean

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/chef/resource/conditional_action_not_nothing.rb', line 29

def continue?
  # @positivity == not_if
  @current_action != :nothing
end

#descriptionObject



38
39
40
# File 'lib/chef/resource/conditional_action_not_nothing.rb', line 38

def description
  "action :nothing"
end

#short_descriptionObject



34
35
36
# File 'lib/chef/resource/conditional_action_not_nothing.rb', line 34

def short_description
  description
end

#to_textObject



42
43
44
# File 'lib/chef/resource/conditional_action_not_nothing.rb', line 42

def to_text
  "not_if { action == :nothing }"
end