Class: SlackSignIn::Identity

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

Instance Method Summary collapse

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

#emailObject



22
23
24
# File 'app/models/slack_sign_in/identity.rb', line 22

def email
  params.dig("user", "email")
end

#nameObject



18
19
20
# File 'app/models/slack_sign_in/identity.rb', line 18

def name
  params.dig("user", "name")
end

#team_idObject



10
11
12
# File 'app/models/slack_sign_in/identity.rb', line 10

def team_id
  params["team_id"]
end

#unique_idObject



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

def unique_id
  "#{team_id}-#{user_id}"
end

#user_idObject



14
15
16
# File 'app/models/slack_sign_in/identity.rb', line 14

def user_id
  params["user_id"]
end