Class: Tag
Overview
The default Tag implementation. A tag attaches semantics to a given object. – FIXME: use index and char() instead of String. ++
Class Method Summary collapse
-
.total_frequency(tags = Tag.all) ⇒ Object
Helper method.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ Tag
constructor
A new instance of Tag.
-
#tag(obj) ⇒ Object
– FIXME: use update_properties here! ++.
-
#tagged ⇒ Object
Return all tagged objects from all categories.
Constructor Details
#initialize(name = nil) ⇒ Tag
Returns a new instance of Tag.
18 19 20 21 |
# File 'lib/glue/taggable.rb', line 18 def initialize(name = nil) @name = name @count = 0 end |
Class Method Details
Instance Method Details
#tag(obj) ⇒ Object
– FIXME: use update_properties here! ++
27 28 29 30 31 |
# File 'lib/glue/taggable.rb', line 27 def tag(obj) send(obj.class.name.underscore.pluralize.to_sym) << obj @count += 1 save! end |
#tagged ⇒ Object
Return all tagged objects from all categories.
35 36 37 |
# File 'lib/glue/taggable.rb', line 35 def tagged # TODO. end |