Class: Redmine::IssueChange

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

Overview

An IssueChange is a change in the history of an Issue, such as assigning it to a different user, or changing its state.

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

#to_sObject

Provide a human-readable description of the change that this object represents.



15
16
17
# File 'lib/redmine/issue_change.rb', line 15

def to_s
  format '%s: %s => %s', name, old_value, new_value
end

#with_statuses(issue_statuses) ⇒ Object

Like #to_s, but use a given map of IDs to human-readable statuses to provide more meaningful information.



21
22
23
24
25
26
27
28
29
# File 'lib/redmine/issue_change.rb', line 21

def with_statuses(issue_statuses)
  if name == 'status_id'
    format 'Status: %s => %s',
           find_issue_status(issue_statuses, old_value),
           find_issue_status(issue_statuses, new_value)
  else
    to_s
  end
end