Skip to content

Commit

Permalink
refactor with string building return
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Quick <[email protected]>
  • Loading branch information
jquick committed Oct 4, 2017
1 parent 29c384e commit 4a3ef8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/resources/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ def ipaddress
end

def to_s
return "Host #{hostname} port #{port} proto #{protocol}" if port
"Host #{hostname}"
resource_name = "Host #{hostname}"
resource_name += " port #{port} proto #{protocol}" if port

resource_name
end

private
Expand Down

0 comments on commit 4a3ef8c

Please sign in to comment.