Skip to content

Commit

Permalink
begin rescue block if business isnt found.
Browse files Browse the repository at this point in the history
  • Loading branch information
brntbeer committed Jul 8, 2012
1 parent 758d10f commit f4e0f2b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/yelpme.rb
Expand Up @@ -76,7 +76,8 @@ def self.nearby(lat, long)
# Returns output!
def self.output(business, options)

text = unless options[:full_output]
begin
text = unless options[:full_output]
%{
Name: #{business.name}
Rating: #{business.rating}
Expand All @@ -86,9 +87,12 @@ def self.output(business, options)
Phone: \e[33m#{business.phone rescue "No Number Posted"}\e[0m
}.gsub(/^ {8}/, '')
else
business
end
else
business
end
rescue
text = "No business found.\nPlease ensure your business or search terms are typed correctly."
end

options[:full_output] ? (pp text) : (puts text)
end
Expand Down

0 comments on commit f4e0f2b

Please sign in to comment.