Class: Facebooker::Mobile

Inherits:
Object
  • Object
show all
Defined in:
lib/facebooker/mobile.rb

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ Mobile



3
4
5
# File 'lib/facebooker/mobile.rb', line 3

def initialize(session)
  @session = session
end

Instance Method Details

#can_send(user) ⇒ Object

Used to determine whether the user identified by “uid” has enabled SMS for this application.



8
9
10
# File 'lib/facebooker/mobile.rb', line 8

def can_send(user)
  @session.post('facebook.sms.canSend', :uid => User.cast_to_facebook_id(user))
end

#send(user, message) ⇒ Object

Send the given message to the user. See wiki.developers.facebook.com/index.php/Mobile



14
15
16
17
18
# File 'lib/facebooker/mobile.rb', line 14

def send(user, message)
  @session.post('facebook.sms.send', 
    {:uid => User.cast_to_facebook_id(user), 
    :message => message}, false)
end