Class: Redmine::Issue

Inherits:
Value
  • Object
show all
Defined in:
lib/redmine/issue.rb

Overview

Represents a single issue (ticket) in the Redmine system.

Instance Attribute Summary

Attributes inherited from Value

#hash

Instance Method Summary collapse

Methods inherited from Value

attribute, attributes, #eql?, #initialize, parse_value, #to_a, #to_h, #with

Constructor Details

This class inherits a constructor from Redmine::Value

Instance Method Details

#activityObject

List event history for this Issue as IssueEvent objects.



27
28
29
30
31
# File 'lib/redmine/issue.rb', line 27

def activity
  journals.map do |event|
    IssueEvent.new(event)
  end
end

#lead_timeObject

Calculate the lead time for this ticket.

This returns the difference in days between the closed date and the start date.



37
38
39
40
# File 'lib/redmine/issue.rb', line 37

def lead_time
  return Float::INFINITY unless closed_on
  (closed_on - [created_on, start_date].max).to_i
end