Class: SlackSignIn::Result
- Inherits:
-
Object
- Object
- SlackSignIn::Result
- Defined in:
- app/models/slack_sign_in/result.rb
Instance Method Summary collapse
- #error ⇒ Object
- #identity ⇒ Object
-
#initialize(result) ⇒ Result
constructor
A new instance of Result.
- #successful? ⇒ Boolean
Constructor Details
#initialize(result) ⇒ Result
Returns a new instance of Result.
2 3 4 |
# File 'app/models/slack_sign_in/result.rb', line 2 def initialize(result) @result = result || {"error" => "invalid_request"} end |
Instance Method Details
#error ⇒ Object
16 17 18 |
# File 'app/models/slack_sign_in/result.rb', line 16 def error result["error"] end |
#identity ⇒ Object
10 11 12 13 14 |
# File 'app/models/slack_sign_in/result.rb', line 10 def identity return unless successful? SlackSignIn::Identity.new(result["success"]) end |
#successful? ⇒ Boolean
6 7 8 |
# File 'app/models/slack_sign_in/result.rb', line 6 def successful? result.key? "success" end |