Class: Redwood::LabelService
Overview
Provides label tweaking service to the user. Working as the backend of ConsoleMode.
Should become the backend of bin/sup-tweak-labels in the future.
Instance Method Summary collapse
- #add_labels(query, *labels) ⇒ Object
-
#initialize(index = Index.instance) ⇒ LabelService
constructor
A new instance of LabelService.
- #remove_labels(query, *labels) ⇒ Object
Constructor Details
#initialize(index = Index.instance) ⇒ LabelService
Returns a new instance of LabelService.
10 11 12 |
# File 'lib/sup/service/label_service.rb', line 10 def initialize index=Index.instance @index = index end |
Instance Method Details
#add_labels(query, *labels) ⇒ Object
14 15 16 17 18 |
# File 'lib/sup/service/label_service.rb', line 14 def add_labels query, *labels (query) do |m| labels.each {|l| m.add_label l } end end |
#remove_labels(query, *labels) ⇒ Object
20 21 22 23 24 |
# File 'lib/sup/service/label_service.rb', line 20 def remove_labels query, *labels (query) do |m| labels.each {|l| m.remove_label l } end end |