Class: Sso::Pingback
- Inherits:
-
Object
- Object
- Sso::Pingback
- Includes:
- Logging, Warden::Support
- Defined in:
- app/models/sso/pingback.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#warden ⇒ Object
readonly
Returns the value of attribute warden.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
- #execute ⇒ Object
-
#initialize(user, warden, options) ⇒ Pingback
constructor
A new instance of Pingback.
Methods included from Warden::Support
Methods included from Logging
#debug, #error, #fatal, #info, #warn
Constructor Details
#initialize(user, warden, options) ⇒ Pingback
Returns a new instance of Pingback.
16 17 18 |
# File 'app/models/sso/pingback.rb', line 16 def initialize(user, warden, ) @user, @warden, @options = user, warden, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'app/models/sso/pingback.rb', line 6 def @options end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'app/models/sso/pingback.rb', line 6 def user @user end |
#warden ⇒ Object (readonly)
Returns the value of attribute warden.
6 7 8 |
# File 'app/models/sso/pingback.rb', line 6 def warden @warden end |
Class Method Details
.to_proc ⇒ Object
10 11 12 13 14 |
# File 'app/models/sso/pingback.rb', line 10 def self.to_proc proc do |user, warden, | new(user, warden, ).call end end |
Instance Method Details
#call ⇒ Object
20 21 22 |
# File 'app/models/sso/pingback.rb', line 20 def call execute if logged_in? end |
#execute ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/sso/pingback.rb', line 24 def execute return false unless sso_session = ::Sso::Session.find_by_id(session["sso_session_id"]) ::Doorkeeper::Application.all.each do |app| debug { "Pingback Sso::Pingback for #{app.inspect}" } unless app.pingback_uri.blank? data = ::Sso::SessionSerializer.new(sso_session) debug { data.inspect } notifier = ::Sso::Notifier.new(app.pingback_uri, app.uid, app.secret, data) notifier.execute end end end |