Class: SlackSignIn::Identity
- Inherits:
-
Object
- Object
- SlackSignIn::Identity
- Defined in:
- app/models/slack_sign_in/identity.rb
Instance Method Summary collapse
- #avatar(size: 48) ⇒ Object
- #email ⇒ Object
-
#initialize(params) ⇒ Identity
constructor
A new instance of Identity.
- #name ⇒ Object
- #team_id ⇒ Object
- #unique_id ⇒ Object
- #user_id ⇒ Object
Constructor Details
#initialize(params) ⇒ Identity
Returns a new instance of Identity.
2 3 4 |
# File 'app/models/slack_sign_in/identity.rb', line 2 def initialize(params) @params = params end |
Instance Method Details
#avatar(size: 48) ⇒ Object
26 27 28 |
# File 'app/models/slack_sign_in/identity.rb', line 26 def avatar(size: 48) params.dig("user", "image_#{size}") end |
#email ⇒ Object
22 23 24 |
# File 'app/models/slack_sign_in/identity.rb', line 22 def email params.dig("user", "email") end |
#name ⇒ Object
18 19 20 |
# File 'app/models/slack_sign_in/identity.rb', line 18 def name params.dig("user", "name") end |
#team_id ⇒ Object
10 11 12 |
# File 'app/models/slack_sign_in/identity.rb', line 10 def team_id params["team_id"] end |
#unique_id ⇒ Object
6 7 8 |
# File 'app/models/slack_sign_in/identity.rb', line 6 def unique_id "#{team_id}-#{user_id}" end |
#user_id ⇒ Object
14 15 16 |
# File 'app/models/slack_sign_in/identity.rb', line 14 def user_id params["user_id"] end |