Class: MotionPusherClient
- Inherits:
-
Object
- Object
- MotionPusherClient
- Defined in:
- lib/motion-pusher/motion-pusher-client.rb
Instance Method Summary collapse
- #config ⇒ Object
- #connect ⇒ Object
-
#initialize(delegate) ⇒ MotionPusherClient
constructor
A new instance of MotionPusherClient.
- #subscribe_to(channel) ⇒ Object
- #subscribe_to_private(channel) ⇒ Object
Constructor Details
#initialize(delegate) ⇒ MotionPusherClient
Returns a new instance of MotionPusherClient.
2 3 4 5 6 7 8 |
# File 'lib/motion-pusher/motion-pusher-client.rb', line 2 def initialize(delegate) self.client = PTPusher.pusherWithKey( self.config['key'], delegate: delegate, encrypted: true ) end |
Instance Method Details
#config ⇒ Object
22 23 24 |
# File 'lib/motion-pusher/motion-pusher-client.rb', line 22 def config @config ||= NSBundle.mainBundle.objectForInfoDictionaryKey('MotionPusher') end |
#connect ⇒ Object
10 11 12 |
# File 'lib/motion-pusher/motion-pusher-client.rb', line 10 def connect client.connect end |
#subscribe_to(channel) ⇒ Object
14 15 16 |
# File 'lib/motion-pusher/motion-pusher-client.rb', line 14 def subscribe_to(channel) client.subscribeToChannelNamed(channel) end |
#subscribe_to_private(channel) ⇒ Object
18 19 20 |
# File 'lib/motion-pusher/motion-pusher-client.rb', line 18 def subscribe_to_private(channel) client.subscribeToPrivateChannelNamed(channel) end |