Skip to content

Commit

Permalink
Use defined? to check for instance variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Jul 11, 2014
1 parent 8ebbcb0 commit aa59fcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/chef/resource/lwrp_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def self.default_action(action_name=NULL_ARG)
# Adds +action_names+ to the list of valid actions for this resource.
def self.actions(*action_names)
if action_names.empty?
@actions || from_superclass(:actions, []).dup
defined?(@actions) ? @actions : from_superclass(:actions, []).dup
else
# BC-compat way for checking if actions have already been defined
if @actions
if defined?(@actions)
@actions.push(*action_names)
else
@actions = action_names
Expand Down

0 comments on commit aa59fcc

Please sign in to comment.