Class: RailsExecution::Label

Inherits:
AppModel show all
Defined in:
app/models/rails_execution/label.rb

Constant Summary collapse

SPECIAL_LABLES =
['scheduled', 'repeat']
COLORS =
'red pink purple deep-purple indigo blue light-blue cyan teal green orange deep-orange brown grey blue-grey'.split

Instance Method Summary collapse

Instance Method Details

#colorObject



11
12
13
14
# File 'app/models/rails_execution/label.rb', line 11

def color
  color_index = self.name.to_s.chars.sum(&:ord) % COLORS.size
  COLORS[color_index]
end