Class: Skala::Adapter::Search::Request::SortRequest::Order

Inherits:
Virtus::Attribute
  • Object
show all
Defined in:
lib/skala/adapter/search/request/sort_request.rb

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Object



7
8
9
10
# File 'lib/skala/adapter/search/request/sort_request.rb', line 7

def coerce(value)
  value = value.try(:to_s).try(:downcase)
  ["asc", "desc"].include?(value) ? value : nil
end