Class: QueryFilter
Overview
Instance Method Summary
collapse
#current_language, #day_letter, #day_name, #find_language, #format_date, #format_hours, #format_time, #l, #l_hours, #l_hours_short, #l_or_humanize, #languages_options, #ll, #lu, #month_name, #set_language_if_valid, #valid_languages
Constructor Details
#initialize(field, options) ⇒ QueryFilter
Returns a new instance of QueryFilter
168
169
170
171
172
173
174
|
# File 'app/models/query.rb', line 168
def initialize(field, options)
@field = field.to_s
@options = options
@options[:name] ||= l(options[:label] || "field_#{field}".gsub(/_id$/, ''))
@remote = options.key?(:remote) ? options[:remote] : options[:values].is_a?(Proc)
end
|
Instance Method Details
#[](arg) ⇒ Object
176
177
178
179
180
181
182
|
# File 'app/models/query.rb', line 176
def [](arg)
if arg == :values
values
else
@options[arg]
end
end
|
#remote ⇒ Object
194
195
196
|
# File 'app/models/query.rb', line 194
def remote
@remote
end
|
#values ⇒ Object
184
185
186
187
188
189
190
191
192
|
# File 'app/models/query.rb', line 184
def values
@values ||= begin
values = @options[:values]
if values.is_a?(Proc)
values = values.call
end
values
end
end
|