Class: Role

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/role.rb

Class Method Summary collapse

Class Method Details

.all_rolesObject



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

def self.all_roles
  [ "System Admin", "Puzzle Aesthetician", "Puzzle Setter", "Member" ]
end

.game_rolesObject



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

def self.game_roles
  [ "Puzzle Aesthetician", "Puzzle Setter" ]
end

.role_color(role) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/models/role.rb', line 18

def self.role_color(role)
  map = {
    "System Admin" => "rgba(255, 0, 0, 0.4)",
    "Wordle" => "rgba(0, 128, 0, 0.4)",
    "Spelling Bee" => "rgba(255, 217, 0, 0.4)",
    "Letter Boxed" => "rgba(0, 128, 255, 0.4)"
  }
  if map[role]
    map[role]
  else
    "rgba(0, 0, 0, 0.4)"
  end
end