Class: QueryFilter
Instance Method Summary
collapse
#abbr_day_name, #current_language, #day_letter, #day_name, #find_language, #format_date, #format_hours, #format_time, included, #l, #l_hours, #l_hours_short, #l_or_humanize, #languages_options, #ll, #lu, #month_name, #normalize_float, #set_language_if_valid, #valid_languages
Constructor Details
#initialize(field, options) ⇒ QueryFilter
Returns a new instance of QueryFilter.
219
220
221
222
223
224
225
|
# File 'app/models/query.rb', line 219
def initialize(field, options)
@field = field.to_s
@options = options
@options[:name] ||= l(options[:label] || "field_#{field}".delete_suffix('_id'))
@remote = options.key?(:remote) ? options[:remote] : options[:values].is_a?(Proc)
end
|
Instance Method Details
#[](arg) ⇒ Object
227
228
229
230
231
232
233
|
# File 'app/models/query.rb', line 227
def [](arg)
if arg == :values
values
else
@options[arg]
end
end
|
#remote ⇒ Object
245
246
247
|
# File 'app/models/query.rb', line 245
def remote
@remote
end
|
#values ⇒ Object
235
236
237
238
239
240
241
242
243
|
# File 'app/models/query.rb', line 235
def values
@values ||= begin
values = @options[:values]
if values.is_a?(Proc)
values = values.call
end
values
end
end
|