Class: Push::Daemon::Apns

Inherits:
Object
  • Object
show all
Defined in:
lib/push/daemon/apns.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Apns

Returns a new instance of Apns.



6
7
8
9
10
11
# File 'lib/push/daemon/apns.rb', line 6

def initialize(options)
  self.configuration = options

  @feedback_receiver = ApnsSupport::FeedbackReceiver.new(self)
  start_feedback
end

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



4
5
6
# File 'lib/push/daemon/apns.rb', line 4

def configuration
  @configuration
end

Instance Method Details

#connectiontypeObject



22
23
24
# File 'lib/push/daemon/apns.rb', line 22

def connectiontype
  ApnsSupport::ConnectionApns
end

#pushconnectionsObject



13
14
15
# File 'lib/push/daemon/apns.rb', line 13

def pushconnections
  self.configuration[:connections]
end

#start_feedbackObject



26
27
28
# File 'lib/push/daemon/apns.rb', line 26

def start_feedback
  @feedback_receiver.start
end

#stopObject



34
35
36
# File 'lib/push/daemon/apns.rb', line 34

def stop
  stop_feedback
end

#stop_feedbackObject



30
31
32
# File 'lib/push/daemon/apns.rb', line 30

def stop_feedback
  @feedback_receiver.stop
end

#totalconnectionsObject



17
18
19
20
# File 'lib/push/daemon/apns.rb', line 17

def totalconnections
  # + feedback
  pushconnections + 1
end