Sha256: 75b7ea93f11aacda0c18707d4dd4a88845996861a1cea2fa059c4b16f89ccc33
Contents?: true
Size: 540 Bytes
Versions: 2
Compression:
Stored size: 540 Bytes
Contents
require "whitelist_scope" module Sortify include WhitelistScope alias sort_option whitelist_scope alias sort_options whitelist def default_sort_option(name) @default_sort_option = name.to_sym end def sortify(sort_option = "") if sort_option.empty? begin call_whitelisted_scope(@default_sort_option) rescue raise NoMethodError, "The default sort option you provided, '#{@default_sort_option}', does not exist." end else call_whitelisted_scope(sort_option) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sortify-0.1.9 | lib/sortify.rb |
sortify-0.1.8 | lib/sortify.rb |