Class: Rack::RackSeo::TitleFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/rack-seo/title_formatter.rb

Class Method Summary collapse

Class Method Details

.parse_meta_title(document, title_format) ⇒ Object



3
4
5
6
7
# File 'lib/rack-seo/title_formatter.rb', line 3

def self.parse_meta_title(document, title_format)
  title_format.gsub(/{{([^\}]+)}}/) do
    "#{document.css($1).first.text rescue nil}"
  end
end