class Doorkeepr::Rails::Nerve

Attributes

nerve[RW]
thread[RW]

Public Class Methods

new() click to toggle source
# File lib/doorkeepr/rails/nerve.rb, line 8
def initialize
  return unless Doorkeepr.config.to_h[:entrance]
  Rails.announce Entrance.new.service
end

Public Instance Methods

depublish() click to toggle source
# File lib/doorkeepr/rails/nerve.rb, line 20
def depublish
  return unless thread
  ::Rails.logger.debug "depublish service"
  thread.kill
end
publish() click to toggle source
# File lib/doorkeepr/rails/nerve.rb, line 12
def publish
  return unless Doorkeepr.config.to_h[:entrance]
  ::Rails.logger.debug "publish service"
  @nerve = ::Nerve::Nerve.new Rails.config.to_nerve
  @thread = Thread.new do
    nerve.run
  end
end