Navigation Menu

Skip to content

Commit

Permalink
Don't use guard-if/unless multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 27, 2014
1 parent 58d49c0 commit ccbfdbc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/droonga/serf.rb
Expand Up @@ -147,12 +147,13 @@ def status
end

def role
return :default unless status[:role]

role = status[:role].to_sym
return :default unless self.class::ROLE.keys.include?(role)

role
if status[:role]
role = status[:role].to_sym
if self.class::ROLE.keys.include?(role)
return role
end
end
:default
end

def port
Expand Down

0 comments on commit ccbfdbc

Please sign in to comment.