Class: Calagator::Venue::Search
- Inherits:
-
Struct
- Object
- Struct
- Calagator::Venue::Search
- Defined in:
- app/models/calagator/venue/search.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
Returns the value of attribute all.
-
#closed ⇒ Object
Returns the value of attribute closed.
-
#include_closed ⇒ Object
Returns the value of attribute include_closed.
-
#query ⇒ Object
Returns the value of attribute query.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#wifi ⇒ Object
Returns the value of attribute wifi.
Instance Method Summary collapse
- #failure_message ⇒ Object
- #hard_failure? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Search
constructor
A new instance of Search.
- #most_active_venues ⇒ Object
- #newest_venues ⇒ Object
- #results? ⇒ Boolean
- #venues ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Search
Returns a new instance of Search.
5 6 7 8 9 |
# File 'app/models/calagator/venue/search.rb', line 5 def initialize attributes = {} members.each do |key| send "#{key}=", attributes[key] end end |
Instance Attribute Details
#all ⇒ Object
Returns the value of attribute all
4 5 6 |
# File 'app/models/calagator/venue/search.rb', line 4 def all @all end |
#closed ⇒ Object
Returns the value of attribute closed
4 5 6 |
# File 'app/models/calagator/venue/search.rb', line 4 def closed @closed end |
#include_closed ⇒ Object
Returns the value of attribute include_closed
4 5 6 |
# File 'app/models/calagator/venue/search.rb', line 4 def include_closed @include_closed end |
#query ⇒ Object
Returns the value of attribute query
4 5 6 |
# File 'app/models/calagator/venue/search.rb', line 4 def query @query end |
#tag ⇒ Object
Returns the value of attribute tag
4 5 6 |
# File 'app/models/calagator/venue/search.rb', line 4 def tag @tag end |
#wifi ⇒ Object
Returns the value of attribute wifi
4 5 6 |
# File 'app/models/calagator/venue/search.rb', line 4 def wifi @wifi end |
Instance Method Details
#failure_message ⇒ Object
27 28 29 |
# File 'app/models/calagator/venue/search.rb', line 27 def end |
#hard_failure? ⇒ Boolean
31 32 33 |
# File 'app/models/calagator/venue/search.rb', line 31 def hard_failure? @hard_failure end |
#most_active_venues ⇒ Object
15 16 17 |
# File 'app/models/calagator/venue/search.rb', line 15 def most_active_venues base.business.wifi_status.scope.order('events_count DESC').limit(10) end |
#newest_venues ⇒ Object
19 20 21 |
# File 'app/models/calagator/venue/search.rb', line 19 def newest_venues base.business.wifi_status.scope.order('created_at DESC').limit(10) end |
#results? ⇒ Boolean
23 24 25 |
# File 'app/models/calagator/venue/search.rb', line 23 def results? query || tag || all end |
#venues ⇒ Object
11 12 13 |
# File 'app/models/calagator/venue/search.rb', line 11 def venues @venues ||= perform_search end |