lib/blacklight/document_presenter.rb in blacklight-5.13.0 vs lib/blacklight/document_presenter.rb in blacklight-5.13.1
- old
+ new
@@ -74,11 +74,11 @@
# @option opts [Symbol] :label Render the given field from the document
# @option opts [Proc] :label Evaluate the given proc
# @option opts [String] :label Render the given string
# @param [Symbol, Proc, String] field Render the given field or evaluate the proc or render the given string
def render_document_index_label field, opts ={}
- if field.kind_of? Hash
+ if field.is_a? Hash
Deprecation.warn DocumentPresenter, "Calling render_document_index_label with a hash is deprecated"
field = field[:label]
end
label = case field
when Symbol
@@ -139,10 +139,10 @@
def get_field_values field, field_config, options = {}
# retrieving values
value = case
when (field_config and field_config.highlight)
# retrieve the document value from the highlighting response
- @document.highlight_field(field_config.field).map { |x| x.html_safe } if @document.has_highlight_field? field_config.field
+ @document.highlight_field(field_config.field).map(&:html_safe) if @document.has_highlight_field? field_config.field
when (field_config and field_config.accessor)
# implicit method call
if field_config.accessor === true
@document.send(field)
# arity-1 method call (include the field name in the call)