Method: Microformats::Vcard#coordinates
- Defined in:
- lib/vcard.rb
#coordinates(lat, lng, opts = {}) ⇒ Object
Accepts latitude and longitude as arguments. It will only output a visible text node if you provide the :text option.
OPTIONS
-
:text - String, the text will be be displayed inside the ‘geo’ wrapper
135 136 137 138 139 140 141 142 |
# File 'lib/vcard.rb', line 135 def coordinates(lat, lng, opts = {}) = content_tag('', :tag => :meta, :itemprop => 'latitude', :content => lat) = content_tag('', :tag => :meta, :itemprop => 'longitude', :content => lng) lat_span = content_tag(content_tag('', :class => 'value-title', :title => lat), :class => 'latitude') lng_span = content_tag(content_tag('', :class => 'value-title', :title => lng), :class => 'longitude') text = opts[:text] || '' content_tag( + + lat_span + lng_span + text, :class => 'geo', :itemprop => 'geo', :itemscope => 'itemscope', :itemtype => 'http://data-vocabulary.org/Geo') end |