Class: Referral::SortsTokens

Inherits:
Object
  • Object
show all
Defined in:
lib/referral/sorts_tokens.rb

Instance Method Summary collapse

Instance Method Details

#call(tokens, options) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/referral/sorts_tokens.rb', line 38

def call(tokens, options)
  if (sort_func = SORT_FUNCTIONS[options[:sort].to_sym])
    sort_func.call(tokens)
  else
    raise Referral::Error.new("Sort '#{options[:sort]} not found in Referral::SORT_FUNCTIONS")
  end
end