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.
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#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
- #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.
6 7 8 9 10 |
# File 'app/models/calagator/venue/search.rb', line 6 def initialize(attributes = {}) members.each do |key| send "#{key}=", attributes[key] end end |
Instance Attribute Details
#all ⇒ Object
Returns the value of attribute all
5 6 7 |
# File 'app/models/calagator/venue/search.rb', line 5 def all @all end |
#closed ⇒ Object
Returns the value of attribute closed
5 6 7 |
# File 'app/models/calagator/venue/search.rb', line 5 def closed @closed end |
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
28 29 30 |
# File 'app/models/calagator/venue/search.rb', line 28 def @failure_message end |
#include_closed ⇒ Object
Returns the value of attribute include_closed
5 6 7 |
# File 'app/models/calagator/venue/search.rb', line 5 def include_closed @include_closed end |
#query ⇒ Object
Returns the value of attribute query
5 6 7 |
# File 'app/models/calagator/venue/search.rb', line 5 def query @query end |
#tag ⇒ Object
Returns the value of attribute tag
5 6 7 |
# File 'app/models/calagator/venue/search.rb', line 5 def tag @tag end |
#wifi ⇒ Object
Returns the value of attribute wifi
5 6 7 |
# File 'app/models/calagator/venue/search.rb', line 5 def wifi @wifi end |
Instance Method Details
#hard_failure? ⇒ Boolean
30 31 32 |
# File 'app/models/calagator/venue/search.rb', line 30 def hard_failure? @hard_failure end |
#most_active_venues ⇒ Object
16 17 18 |
# File 'app/models/calagator/venue/search.rb', line 16 def most_active_venues base.business.wifi_status.scope.order('events_count DESC').limit(10) end |
#newest_venues ⇒ Object
20 21 22 |
# File 'app/models/calagator/venue/search.rb', line 20 def newest_venues base.business.wifi_status.scope.order('created_at DESC').limit(10) end |
#results? ⇒ Boolean
24 25 26 |
# File 'app/models/calagator/venue/search.rb', line 24 def results? query || tag || all end |
#venues ⇒ Object
12 13 14 |
# File 'app/models/calagator/venue/search.rb', line 12 def venues @venues ||= perform_search end |