Class: Sso::Notifier
- Inherits:
-
Object
- Object
- Sso::Notifier
- Defined in:
- app/models/sso/notifier.rb
Instance Attribute Summary collapse
-
#api_id ⇒ Object
readonly
Returns the value of attribute api_id.
-
#api_secret ⇒ Object
readonly
Returns the value of attribute api_secret.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(url, api_id, api_secret, data) ⇒ Notifier
constructor
A new instance of Notifier.
- #request ⇒ Object
- #signed_request ⇒ Object
Constructor Details
#initialize(url, api_id, api_secret, data) ⇒ Notifier
Returns a new instance of Notifier.
10 11 12 13 14 15 |
# File 'app/models/sso/notifier.rb', line 10 def initialize(url, api_id, api_secret, data) @url = url @data = data @api_id = api_id @api_secret = api_secret end |
Instance Attribute Details
#api_id ⇒ Object (readonly)
Returns the value of attribute api_id.
8 9 10 |
# File 'app/models/sso/notifier.rb', line 8 def api_id @api_id end |
#api_secret ⇒ Object (readonly)
Returns the value of attribute api_secret.
8 9 10 |
# File 'app/models/sso/notifier.rb', line 8 def api_secret @api_secret end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'app/models/sso/notifier.rb', line 8 def data @data end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'app/models/sso/notifier.rb', line 7 def url @url end |
Instance Method Details
#execute ⇒ Object
17 18 19 |
# File 'app/models/sso/notifier.rb', line 17 def execute signed_request.execute end |
#request ⇒ Object
21 22 23 |
# File 'app/models/sso/notifier.rb', line 21 def request @request ||= ::RestClient::Request.new(url: url, method: :post, payload: data.to_json, headers: {:content_type => :json, :accept => :json}) end |
#signed_request ⇒ Object
25 26 27 |
# File 'app/models/sso/notifier.rb', line 25 def signed_request @signed_request ||= ::ApiAuth.sign!(request, api_id, api_secret) end |