bin/seventeen in seventeen_mon-0.0.3 vs bin/seventeen in seventeen_mon-0.0.4
- old
+ new
@@ -31,13 +31,18 @@
op = ARGV.shift
if OPERATIONS.include?(op)
begin
result = SM.send("find_by_#{op}".to_sym, ARGV.first)
+
+ if result.is_a? Hash
puts <<-EOS
Country: #{result[:country]}
City: #{result[:city]}
EOS
+ else
+ puts "N/A"
+ end
rescue ArgumentError => ex
puts ex.message
rescue Exception => e
\ No newline at end of file