app/app_delegate.rb in motion-firebase-1.0.5 vs app/app_delegate.rb in motion-firebase-1.0.6
- old
+ new
@@ -52,11 +52,11 @@
# Initialize array that will store chat messages.
self.chat = []
# Initialize the root of our Firebase namespace.
- self.firebase = Firebase.alloc.initWithUrl(FirechatNS)
+ self.firebase = Firebase.new(FirechatNS)
# Pick a random number between 1-1000 for our username.
self.title = "Guest0x#{(rand * 1000).round.to_s(16).upcase}"
nameField.setTitle(self.title, forState:UIControlStateNormal)
@@ -74,10 +74,10 @@
def textFieldShouldReturn(text_field)
text_field.resignFirstResponder
# This will also add the message to our local array self.chat because
# the FEventTypeChildAdded event will be immediately fired.
- self.firebase[].setValue({'name' => self.title, 'text' => text_field.text})
+ self.firebase << {'name' => self.title, 'text' => text_field.text}
text_field.text = ''
false
end