Class: Workarea::Sort::Collection

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/models/workarea/sort.rb

Instance Method Summary collapse

Constructor Details

#initialize(*sorts) ⇒ Collection

Returns a new instance of Collection.



4
5
6
# File 'app/models/workarea/sort.rb', line 4

def initialize(*sorts)
  super(sorts)
end

Instance Method Details

#find(slug) ⇒ Object



8
9
10
# File 'app/models/workarea/sort.rb', line 8

def find(slug)
  detect { |s| s.to_s == slug.to_s } || first
end