Class: Rpush::Daemon::Apnsp8::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/rpush/daemon/apnsp8/token.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Token

Returns a new instance of Token.



6
7
8
# File 'lib/rpush/daemon/apnsp8/token.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#tokenObject



10
11
12
13
14
15
16
# File 'lib/rpush/daemon/apnsp8/token.rb', line 10

def token
  if @cached_token && !expired_token?
    @cached_token
  else
    new_token
  end
end