Class: Toodledo::Priority

Inherits:
Object
  • Object
show all
Defined in:
lib/toodledo/priority.rb

Overview

A priority enum.

Constant Summary collapse

NEGATIVE =
-1
LOW =
0
MEDIUM =
1
HIGH =
2
TOP =
3
PRIORITY_ARRAY =
[ TOP, HIGH, MEDIUM, LOW, NEGATIVE ]

Class Method Summary collapse

Class Method Details

.eachObject



20
21
22
# File 'lib/toodledo/priority.rb', line 20

def self.each
  PRIORITY_ARRAY.each{|value| yield(value)}
end

.valid?(input) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
# File 'lib/toodledo/priority.rb', line 24

def self.valid?(input)
  for priority in PRIORITY_ARRAY
    if input == priority
      return true
    end        
  end
  return false
end