Class: Redmine::Helpers::TimeReport
- Inherits:
-
Object
- Object
- Redmine::Helpers::TimeReport
- Defined in:
- lib/redmine/helpers/time_report.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#criteria ⇒ Object
readonly
Returns the value of attribute criteria.
-
#hours ⇒ Object
readonly
Returns the value of attribute hours.
-
#periods ⇒ Object
readonly
Returns the value of attribute periods.
-
#total_hours ⇒ Object
readonly
Returns the value of attribute total_hours.
Instance Method Summary collapse
- #available_criteria ⇒ Object
-
#initialize(project, issue, criteria, columns, time_entry_scope) ⇒ TimeReport
constructor
A new instance of TimeReport.
Constructor Details
#initialize(project, issue, criteria, columns, time_entry_scope) ⇒ TimeReport
Returns a new instance of TimeReport
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/redmine/helpers/time_report.rb', line 23 def initialize(project, issue, criteria, columns, time_entry_scope) @project = project @issue = issue @criteria = criteria || [] @criteria = @criteria.select{|criteria| available_criteria.has_key? criteria} @criteria.uniq! @criteria = @criteria[0,3] @columns = (columns && %w(year month week day).include?(columns)) ? columns : 'month' @scope = time_entry_scope run end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns
21 22 23 |
# File 'lib/redmine/helpers/time_report.rb', line 21 def columns @columns end |
#criteria ⇒ Object (readonly)
Returns the value of attribute criteria
21 22 23 |
# File 'lib/redmine/helpers/time_report.rb', line 21 def criteria @criteria end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours
21 22 23 |
# File 'lib/redmine/helpers/time_report.rb', line 21 def hours @hours end |
#periods ⇒ Object (readonly)
Returns the value of attribute periods
21 22 23 |
# File 'lib/redmine/helpers/time_report.rb', line 21 def periods @periods end |
#total_hours ⇒ Object (readonly)
Returns the value of attribute total_hours
21 22 23 |
# File 'lib/redmine/helpers/time_report.rb', line 21 def total_hours @total_hours end |
Instance Method Details
#available_criteria ⇒ Object
38 39 40 |
# File 'lib/redmine/helpers/time_report.rb', line 38 def available_criteria @available_criteria || load_available_criteria end |