Module: Rpush::Client::ActiveModel::Adm::App

Included in:
Rpush::Client::ActiveRecord::Adm::App, Redis::Adm::App
Defined in:
lib/rpush/client/active_model/adm/app.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
# File 'lib/rpush/client/active_model/adm/app.rb', line 6

def self.included(base)
  base.instance_eval do
    validates :client_id, :client_secret, presence: true
  end
end

Instance Method Details

#access_token_expired?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rpush/client/active_model/adm/app.rb', line 12

def access_token_expired?
  access_token_expiration.nil? || access_token_expiration < Time.now
end

#service_nameObject



16
17
18
# File 'lib/rpush/client/active_model/adm/app.rb', line 16

def service_name
  'adm'
end