Class: Workarea::Sort::Collection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Workarea::Sort::Collection
- Defined in:
- app/models/workarea/sort.rb
Instance Method Summary collapse
- #find(slug) ⇒ Object
-
#initialize(*sorts) ⇒ Collection
constructor
A new instance of Collection.
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 |