Permalink
Browse files

to_s in case of nil for "Who am I"

  • Loading branch information...
1 parent 64c1fc6 commit 87a33c59d29e28884ed76c08bdc0e5eeae9f6225 @Ponyboy47 Ponyboy47 committed Sep 25, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 plugins/siriproxy-example/lib/siriproxy-example.rb
@@ -71,14 +71,14 @@ def initialize(config)
end
listen_for /who am i/i do
- if !self.manager.user_fname.nil?
+ if self.manager.user_fname.nil?
say "I'm sorry but I couldn't retrieve any user data for you.."
elsif self.manager.user_nickname.to_s == "NA"
- say "You are #{self.manager.user_fname} and are using an #{self.manager.user_devicetype} on iOS #{self.manager.user_deviceOS} and are speaking #{self.manager.user_language}."
- say "Your IP address is #{self.manager.user_lastIP} and you are speaking #{self.manager.user_language}."
+ say "You are #{self.manager.user_fname.to_s} and are using an #{self.manager.user_devicetype.to_s} on iOS #{self.manager.user_deviceOS.to_s} and are speaking #{self.manager.user_language.to_s}."
+ say "Your IP address is #{self.manager.user_lastIP.to_s} and you are speaking #{self.manager.user_language.to_s}."
else
- say "You are #{self.manager.user_nickname} and are using an #{self.manager.user_devicetype} on iOS #{self.manager.user_deviceOS} and are speaking #{self.manager.user_language}."
- say "Your IP address is #{self.manager.user_lastIP} and you are speaking #{self.manager.user_language}."
+ say "You are #{self.manager.user_nickname.to_s} and are using an #{self.manager.user_devicetype.to_s} on iOS #{self.manager.user_deviceOS.to_s} and are speaking #{self.manager.user_language.to_s}."
+ say "Your IP address is #{self.manager.user_lastIP.to_s} and you are speaking #{self.manager.user_language.to_s}."
end
request_completed
end

1 comment on commit 87a33c5

Collaborator

thpryrchn commented on 87a33c5 Sep 25, 2012

Well, All it ever says to me is "I'm sorry but I couldn't find and user data for you"

Please sign in to comment.