Class: Workarea::Sort
- Inherits:
-
Struct
- Object
- Struct
- Workarea::Sort
- Defined in:
- app/models/workarea/sort.rb
Defined Under Namespace
Classes: Collection
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#field ⇒ Object
Returns the value of attribute field.
-
#name ⇒ Object
Returns the value of attribute name.
-
#slug ⇒ Object
Returns the value of attribute slug.
Class Method Summary collapse
- .available ⇒ Object
- .average_order_value ⇒ Object
- .country ⇒ Object
- .destination ⇒ Object
- .downloads ⇒ Object
- .end ⇒ Object
- .last_updated ⇒ Object
- .modified ⇒ Object
- .most_orders ⇒ Object
- .most_spent ⇒ Object
- .name_asc ⇒ Object
- .name_desc ⇒ Object
- .newest ⇒ Object
- .newest_placed ⇒ Object
- .oldest ⇒ Object
- .oldest_placed ⇒ Object
- .path ⇒ Object
- .pending ⇒ Object
- .popularity ⇒ Object
- .postal_code ⇒ Object
- .price_asc ⇒ Object
- .price_desc ⇒ Object
- .published_date ⇒ Object
- .purchased ⇒ Object
- .query ⇒ Object
- .rating ⇒ Object
- .redemptions ⇒ Object
- .region ⇒ Object
- .relevance ⇒ Object
- .sales ⇒ Object
- .sku ⇒ Object
- .start ⇒ Object
- .title ⇒ Object
- .top_sellers ⇒ Object
- .total ⇒ Object
- .type ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction
2 3 4 |
# File 'app/models/workarea/sort.rb', line 2 def direction @direction end |
#field ⇒ Object
Returns the value of attribute field
2 3 4 |
# File 'app/models/workarea/sort.rb', line 2 def field @field end |
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'app/models/workarea/sort.rb', line 2 def name @name end |
#slug ⇒ Object
Returns the value of attribute slug
2 3 4 |
# File 'app/models/workarea/sort.rb', line 2 def slug @slug end |
Class Method Details
.available ⇒ Object
21 22 23 |
# File 'app/models/workarea/sort.rb', line 21 def self.available new(I18n.t('workarea.sorts.available'), :available, :available, :desc) end |
.average_order_value ⇒ Object
25 26 27 |
# File 'app/models/workarea/sort.rb', line 25 def self.average_order_value new(I18n.t('workarea.sorts.average_order_value'), :avg_order, :average_order_value, :desc) end |
.country ⇒ Object
153 154 155 |
# File 'app/models/workarea/sort.rb', line 153 def self.country new(I18n.t('workarea.sorts.country'), :country, :country, :asc) end |
.destination ⇒ Object
29 30 31 |
# File 'app/models/workarea/sort.rb', line 29 def self.destination new(I18n.t('workarea.sorts.destination'), :destination, :destination, :asc) end |
.downloads ⇒ Object
37 38 39 |
# File 'app/models/workarea/sort.rb', line 37 def self.downloads new(I18n.t('workarea.sorts.downloads'), :downloads, :downloads, :desc) end |
.end ⇒ Object
33 34 35 |
# File 'app/models/workarea/sort.rb', line 33 def self.end new(I18n.t('workarea.sorts.end'), :end, :active_ends_at, :desc) end |
.last_updated ⇒ Object
41 42 43 |
# File 'app/models/workarea/sort.rb', line 41 def self.last_updated new(I18n.t('workarea.sorts.last_updated'), :last_updated, :updated_at, :desc) end |
.modified ⇒ Object
45 46 47 |
# File 'app/models/workarea/sort.rb', line 45 def self.modified new(I18n.t('workarea.sorts.modified'), :modified, :updated_at, :desc) end |
.most_orders ⇒ Object
49 50 51 |
# File 'app/models/workarea/sort.rb', line 49 def self.most_orders new(I18n.t('workarea.sorts.most_orders'), :most_orders, :total_orders, :desc) end |
.most_spent ⇒ Object
53 54 55 |
# File 'app/models/workarea/sort.rb', line 53 def self.most_spent new(I18n.t('workarea.sorts.most_spent'), :most_spent, :total_spent, :desc) end |
.name_asc ⇒ Object
57 58 59 |
# File 'app/models/workarea/sort.rb', line 57 def self.name_asc new(I18n.t('workarea.sorts.name_asc'), :name_asc, :name, :asc) end |
.name_desc ⇒ Object
61 62 63 |
# File 'app/models/workarea/sort.rb', line 61 def self.name_desc new(I18n.t('workarea.sorts.name_desc'), :name_desc, :name, :desc) end |
.newest ⇒ Object
65 66 67 |
# File 'app/models/workarea/sort.rb', line 65 def self.newest new(I18n.t('workarea.sorts.newest'), :newest, :created_at, :desc) end |
.newest_placed ⇒ Object
69 70 71 |
# File 'app/models/workarea/sort.rb', line 69 def self.newest_placed new(I18n.t('workarea.sorts.newest'), :newest_placed, :placed_at, :desc) end |
.oldest ⇒ Object
73 74 75 |
# File 'app/models/workarea/sort.rb', line 73 def self.oldest new(I18n.t('workarea.sorts.oldest'), :oldest, :created_at, :asc) end |
.oldest_placed ⇒ Object
77 78 79 |
# File 'app/models/workarea/sort.rb', line 77 def self.oldest_placed new(I18n.t('workarea.sorts.oldest'), :oldest_placed, :placed_at, :asc) end |
.path ⇒ Object
81 82 83 |
# File 'app/models/workarea/sort.rb', line 81 def self.path new(I18n.t('workarea.sorts.path'), :path, :path, :asc) end |
.pending ⇒ Object
85 86 87 |
# File 'app/models/workarea/sort.rb', line 85 def self.pending new(I18n.t('workarea.sorts.pending'), :pending, :pending, :desc) end |
.popularity ⇒ Object
89 90 91 |
# File 'app/models/workarea/sort.rb', line 89 def self.popularity new(I18n.t('workarea.sorts.popularity'), :popularity, :'sorts.views_score', :desc) end |
.postal_code ⇒ Object
157 158 159 |
# File 'app/models/workarea/sort.rb', line 157 def self.postal_code new(I18n.t('workarea.sorts.postal_code'), :postal_code, :postal_code, :asc) end |
.price_asc ⇒ Object
93 94 95 |
# File 'app/models/workarea/sort.rb', line 93 def self.price_asc new(I18n.t('workarea.sorts.price_asc'), :price_asc, :'sorts.price', :asc) end |
.price_desc ⇒ Object
97 98 99 |
# File 'app/models/workarea/sort.rb', line 97 def self.price_desc new(I18n.t('workarea.sorts.price_desc'), :price_desc, :'sorts.price', :desc) end |
.published_date ⇒ Object
149 150 151 |
# File 'app/models/workarea/sort.rb', line 149 def self.published_date new(I18n.t('workarea.sorts.published_date'), :published_date, :published_at, :desc) end |
.purchased ⇒ Object
101 102 103 |
# File 'app/models/workarea/sort.rb', line 101 def self.purchased new(I18n.t('workarea.sorts.purchased'), :purchased, :purchased, :desc) end |
.query ⇒ Object
105 106 107 |
# File 'app/models/workarea/sort.rb', line 105 def self.query new(I18n.t('workarea.sorts.query'), :query, :query, :asc) end |
.rating ⇒ Object
109 110 111 |
# File 'app/models/workarea/sort.rb', line 109 def self. new(I18n.t('workarea.sorts.rating'), :rating, :rating, :desc) end |
.redemptions ⇒ Object
113 114 115 |
# File 'app/models/workarea/sort.rb', line 113 def self.redemptions new(I18n.t('workarea.sorts.redemptions'), :redemptions, :total_redemptions, :desc) end |
.region ⇒ Object
161 162 163 |
# File 'app/models/workarea/sort.rb', line 161 def self.region new(I18n.t('workarea.sorts.region'), :region, :region, :asc) end |
.relevance ⇒ Object
117 118 119 |
# File 'app/models/workarea/sort.rb', line 117 def self.relevance new(I18n.t('workarea.sorts.relevance'), :relevance, nil, nil) end |
.sales ⇒ Object
121 122 123 |
# File 'app/models/workarea/sort.rb', line 121 def self.sales new(I18n.t('workarea.sorts.sales'), :sales, :sales, :desc) end |
.sku ⇒ Object
125 126 127 |
# File 'app/models/workarea/sort.rb', line 125 def self.sku new(I18n.t('workarea.sorts.sku'), :sku, :id, :asc) end |
.start ⇒ Object
129 130 131 |
# File 'app/models/workarea/sort.rb', line 129 def self.start new(I18n.t('workarea.sorts.start'), :start, :active_starts_at, :desc) end |
.title ⇒ Object
133 134 135 |
# File 'app/models/workarea/sort.rb', line 133 def self.title new(I18n.t('workarea.sorts.title'), :title, :title, :asc) end |
.top_sellers ⇒ Object
137 138 139 |
# File 'app/models/workarea/sort.rb', line 137 def self.top_sellers new(I18n.t('workarea.sorts.top_sellers'), :top_sellers, :'sorts.orders_score', :desc) end |
.total ⇒ Object
141 142 143 |
# File 'app/models/workarea/sort.rb', line 141 def self.total new(I18n.t('workarea.sorts.total'), :total, :total_price, :desc) end |
.type ⇒ Object
145 146 147 |
# File 'app/models/workarea/sort.rb', line 145 def self.type new(I18n.t('workarea.sorts.type'), :type, :type, :asc) end |
Instance Method Details
#to_a ⇒ Object
17 18 19 |
# File 'app/models/workarea/sort.rb', line 17 def to_a [name, slug] end |
#to_s ⇒ Object
13 14 15 |
# File 'app/models/workarea/sort.rb', line 13 def to_s self.slug.to_s end |