Module: Awestruct::Extensions::Tagger::TagLinker

Defined in:
lib/awestruct/extensions/tagger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagsObject

Returns the value of attribute tags.



22
23
24
# File 'lib/awestruct/extensions/tagger.rb', line 22

def tags
  @tags
end

Instance Method Details



23
24
25
26
# File 'lib/awestruct/extensions/tagger.rb', line 23

def tag_links(delimiter = ', ', style_class = nil)
  class_attr = (style_class ? ' class="' + style_class + '"' : '')
  tags.map{|tag| %Q{<a#{class_attr} href="#{tag.primary_page.url}">#{tag}</a>}}.join(delimiter)
end