Class: QueryColumn
- Inherits:
-
Object
- Object
- QueryColumn
- Includes:
- Redmine::I18n
- Defined in:
- app/models/query.rb
Overview
Redmine - project management software Copyright (C) 2006-2008 Jean-Philippe Lang
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Direct Known Subclasses
Instance Attribute Summary
-
- (Object) default_order
Returns the value of attribute default_order.
-
- (Object) groupable
Returns the value of attribute groupable.
-
- (Object) name
Returns the value of attribute name.
-
- (Object) sortable
Returns the value of attribute sortable.
Instance Method Summary
- - (Object) caption
-
- (QueryColumn) initialize(name, options = {})
constructor
A new instance of QueryColumn.
-
- (Boolean) sortable?
Returns true if the column is sortable, otherwise false.
- - (Object) value(issue)
Methods included from Redmine::I18n
#current_language, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #ll, #month_name, #set_language_if_valid, #valid_languages
Constructor Details
- (QueryColumn) initialize(name, options = {})
A new instance of QueryColumn
22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/query.rb', line 22 def initialize(name, ={}) self.name = name self.sortable = [:sortable] self.groupable = [:groupable] || false if groupable == true self.groupable = name.to_s end self.default_order = [:default_order] @caption_key = [:caption] || "field_#{name}" end |
Instance Attribute Details
- (Object) default_order
Returns the value of attribute default_order
19 20 21 |
# File 'app/models/query.rb', line 19 def default_order @default_order end |
- (Object) groupable
Returns the value of attribute groupable
19 20 21 |
# File 'app/models/query.rb', line 19 def groupable @groupable end |
- (Object) name
Returns the value of attribute name
19 20 21 |
# File 'app/models/query.rb', line 19 def name @name end |
- (Object) sortable
Returns the value of attribute sortable
19 20 21 |
# File 'app/models/query.rb', line 19 def sortable @sortable end |
Instance Method Details
- (Object) caption
33 34 35 |
# File 'app/models/query.rb', line 33 def caption l(@caption_key) end |
- (Boolean) sortable?
Returns true if the column is sortable, otherwise false
38 39 40 |
# File 'app/models/query.rb', line 38 def sortable? !sortable.nil? end |
- (Object) value(issue)
42 43 44 |
# File 'app/models/query.rb', line 42 def value(issue) issue.send name end |