Class: Terrazzo::Search
- Inherits:
-
Object
- Object
- Terrazzo::Search
- Defined in:
- lib/terrazzo/search.rb
Instance Attribute Summary collapse
-
#dashboard ⇒ Object
readonly
Returns the value of attribute dashboard.
-
#scoped_resource ⇒ Object
readonly
Returns the value of attribute scoped_resource.
-
#term ⇒ Object
readonly
Returns the value of attribute term.
Instance Method Summary collapse
-
#initialize(scoped_resource, dashboard, term) ⇒ Search
constructor
A new instance of Search.
- #run ⇒ Object
Constructor Details
#initialize(scoped_resource, dashboard, term) ⇒ Search
Returns a new instance of Search.
5 6 7 8 9 |
# File 'lib/terrazzo/search.rb', line 5 def initialize(scoped_resource, dashboard, term) @scoped_resource = scoped_resource @dashboard = dashboard @term = term end |
Instance Attribute Details
#dashboard ⇒ Object (readonly)
Returns the value of attribute dashboard.
3 4 5 |
# File 'lib/terrazzo/search.rb', line 3 def dashboard @dashboard end |
#scoped_resource ⇒ Object (readonly)
Returns the value of attribute scoped_resource.
3 4 5 |
# File 'lib/terrazzo/search.rb', line 3 def scoped_resource @scoped_resource end |
#term ⇒ Object (readonly)
Returns the value of attribute term.
3 4 5 |
# File 'lib/terrazzo/search.rb', line 3 def term @term end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/terrazzo/search.rb', line 11 def run if term.blank? scoped_resource else search_results end end |