Class: SlackSignIn::Result

Inherits:
Object
  • Object
show all
Defined in:
app/models/slack_sign_in/result.rb

Instance Method Summary collapse

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

#errorObject



16
17
18
# File 'app/models/slack_sign_in/result.rb', line 16

def error
  result["error"]
end

#identityObject



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

Returns:

  • (Boolean)


6
7
8
# File 'app/models/slack_sign_in/result.rb', line 6

def successful?
  result.key? "success"
end