Class: Tag::Runner
- Inherits:
-
Boson::Runner
- Object
- Boson::Runner
- Tag::Runner
- Defined in:
- lib/tag/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add(*items) ⇒ Object
- #items ⇒ Object
- #list(tag, options = {}) ⇒ Object
- #models ⇒ Object
- #rm(*items) ⇒ Object
- #tags(*args) ⇒ Object
- #tree(options = {}) ⇒ Object
Class Method Details
.model_option ⇒ Object
5 6 7 |
# File 'lib/tag/runner.rb', line 5 def self.model_option option :model, :type => :string end |
Instance Method Details
#add(*items) ⇒ Object
12 13 14 15 |
# File 'lib/tag/runner.rb', line 12 def add(*items) = items[-1].is_a?(Hash) ? items.pop : {} Tag.store([:model]).multi_tag(items, [:tags]) end |
#list(tag, options = {}) ⇒ Object
27 28 29 |
# File 'lib/tag/runner.rb', line 27 def list(tag, ={}) puts Tag.store([:model]).list(tag) end |
#rm(*items) ⇒ Object
20 21 22 23 |
# File 'lib/tag/runner.rb', line 20 def rm(*items) = items[-1].is_a?(Hash) ? items.pop : {} Tag.store([:model]).multi_remove_tag(items, [:tags]) end |