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, criteria, columns, time_entry_scope) ⇒ TimeReport
constructor
A new instance of TimeReport.
Constructor Details
#initialize(project, criteria, columns, time_entry_scope) ⇒ TimeReport
Returns a new instance of TimeReport.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/redmine/helpers/time_report.rb', line 25 def initialize(project, criteria, columns, time_entry_scope) @project = project @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.
23 24 25 |
# File 'lib/redmine/helpers/time_report.rb', line 23 def columns @columns end |
#criteria ⇒ Object (readonly)
Returns the value of attribute criteria.
23 24 25 |
# File 'lib/redmine/helpers/time_report.rb', line 23 def criteria @criteria end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
23 24 25 |
# File 'lib/redmine/helpers/time_report.rb', line 23 def hours @hours end |
#periods ⇒ Object (readonly)
Returns the value of attribute periods.
23 24 25 |
# File 'lib/redmine/helpers/time_report.rb', line 23 def periods @periods end |
#total_hours ⇒ Object (readonly)
Returns the value of attribute total_hours.
23 24 25 |
# File 'lib/redmine/helpers/time_report.rb', line 23 def total_hours @total_hours end |
Instance Method Details
#available_criteria ⇒ Object
39 40 41 |
# File 'lib/redmine/helpers/time_report.rb', line 39 def available_criteria @available_criteria || load_available_criteria end |