Class: Jirify::Models::Status
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
client, #initialize, #method_missing, #respond_to_missing?
Constructor Details
This class inherits a constructor from Jirify::Models::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Jirify::Models::Base
Class Method Details
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/jirify/models/status.rb', line 16 def <=>(other) this_index = Status.status_order.index(name) other_index = Status.status_order.index(other.name) return 1 if other_index.nil? return 0 if this_index.nil? this_index - other_index end |
#pretty_name ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/jirify/models/status.rb', line 4 def pretty_name justified = "(#{name})".rjust(longest_status_name + 2) case name when Config.statuses['blocked'] then justified.red when Config.statuses['done'] then justified.green when Config.statuses['in_progress'] then justified.blue when Config.statuses['in_review'] then justified.yellow when Config.statuses['todo'] then justified.black else justified end end |