Class: Ecm::Tags::TagSearch
- Inherits:
-
Object
- Object
- Ecm::Tags::TagSearch
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/ecm/tags/tag_search.rb
Instance Attribute Summary collapse
-
#exact ⇒ Object
Returns the value of attribute exact.
-
#result ⇒ Object
Returns the value of attribute result.
-
#tag_list ⇒ Object
Returns the value of attribute tag_list.
-
#taggable_classes ⇒ Object
Returns the value of attribute taggable_classes.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#exact ⇒ Object
Returns the value of attribute exact.
5 6 7 |
# File 'app/models/ecm/tags/tag_search.rb', line 5 def exact @exact end |
#result ⇒ Object
Returns the value of attribute result.
5 6 7 |
# File 'app/models/ecm/tags/tag_search.rb', line 5 def result @result end |
#tag_list ⇒ Object
Returns the value of attribute tag_list.
5 6 7 |
# File 'app/models/ecm/tags/tag_search.rb', line 5 def tag_list @tag_list end |
#taggable_classes ⇒ Object
Returns the value of attribute taggable_classes.
5 6 7 |
# File 'app/models/ecm/tags/tag_search.rb', line 5 def taggable_classes @taggable_classes end |
Class Method Details
.call(*args) ⇒ Object
9 10 11 |
# File 'app/models/ecm/tags/tag_search.rb', line 9 def self.call(*args) new(*args).do_work end |
.i18n_scope ⇒ Object
13 14 15 |
# File 'app/models/ecm/tags/tag_search.rb', line 13 def self.i18n_scope :activerecord end |
Instance Method Details
#do_work ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/ecm/tags/tag_search.rb', line 17 def do_work say "#{self.class.name} running..." output = result output.each do |klass, resources| say "Found #{resources.size} #{klass.constantize.model_name.human(count: :other)}:", indent: 1 say resources.inspect, indent: 2 end say 'done' output end |
#result! ⇒ Object
36 37 38 39 |
# File 'app/models/ecm/tags/tag_search.rb', line 36 def result! @result = nil result end |