Class: Metaa::TagCollection
- Inherits:
-
Object
- Object
- Metaa::TagCollection
- Defined in:
- lib/metaa/tag_collection.rb
Instance Method Summary collapse
- #add(new_tags) ⇒ Object
- #html ⇒ Object
-
#initialize(tags = []) ⇒ TagCollection
constructor
A new instance of TagCollection.
- #tags ⇒ Object
Constructor Details
#initialize(tags = []) ⇒ TagCollection
Returns a new instance of TagCollection.
3 4 5 |
# File 'lib/metaa/tag_collection.rb', line 3 def initialize( = []) add() end |
Instance Method Details
#add(new_tags) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/metaa/tag_collection.rb', line 7 def add() = [] if !.is_a? Array .each do |tag| tag = Tag.new(tag) if !tag.is_a?(Tag) << tag end end |
#html ⇒ Object
19 20 21 |
# File 'lib/metaa/tag_collection.rb', line 19 def html .map(&:html).join.html_safe end |
#tags ⇒ Object
15 16 17 |
# File 'lib/metaa/tag_collection.rb', line 15 def @tags ||= [] end |