18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/visit_card/models/vcard_adr.rb', line 18
def to_hcard(options = {})
result = []
result << "<span class='type'>#{types.join(', ').titleize}</span>" unless types.empty?
tag_name = options.fetch(:tag_name, 'span')
SERIALZABLE_ATTRIBUTES.each do |attr_name|
result << wrap_attribute(attr_name, tag_name)
end
result.compact!
main_tag_name = options.fetch(:main_tag_name, 'div')
("<#{main_tag_name} class='adr'>" << result.join(' ') << "</#{main_tag_name}>").html_safe
end
|