Class: ApnsKit::Connection
- Inherits:
-
Object
- Object
- ApnsKit::Connection
- Defined in:
- lib/apns_kit/connection.rb
Instance Attribute Summary collapse
-
#connected ⇒ Object
readonly
Returns the value of attribute connected.
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(uri, certificate) ⇒ Connection
constructor
A new instance of Connection.
- #open ⇒ Object
- #ping ⇒ Object
Constructor Details
#initialize(uri, certificate) ⇒ Connection
Returns a new instance of Connection.
16 17 18 19 20 21 |
# File 'lib/apns_kit/connection.rb', line 16 def initialize(uri, certificate) @uri = uri @certificate = certificate @connected = false @mutex = Mutex.new end |
Instance Attribute Details
#connected ⇒ Object (readonly)
Returns the value of attribute connected.
10 11 12 |
# File 'lib/apns_kit/connection.rb', line 10 def connected @connected end |
#http ⇒ Object (readonly)
Returns the value of attribute http.
14 15 16 |
# File 'lib/apns_kit/connection.rb', line 14 def http @http end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
12 13 14 |
# File 'lib/apns_kit/connection.rb', line 12 def uri @uri end |
Instance Method Details
#close ⇒ Object
29 30 31 |
# File 'lib/apns_kit/connection.rb', line 29 def close shutdown if !@thread.nil? end |
#open ⇒ Object
23 24 25 26 27 |
# File 'lib/apns_kit/connection.rb', line 23 def open if !connected && (@thread.nil? || @thread.stop?) start end end |