module Metas::Helpers::Tags::InstanceMethods

Public Instance Methods

get_meta(attr) click to toggle source
# File lib/metas/helpers/tags.rb, line 19
def get_meta(attr)
  split_attr = attr.split(":")
  metas = meta_main.normalize.deep_stringify_keys
  return nil if metas[split_attr[0]].nil?

  metas[split_attr[0]][split_attr[1]]
end
meta_tags() click to toggle source
# File lib/metas/helpers/tags.rb, line 9
def meta_tags
  meta_main.normalize.each_with_object([]) do |(tag, values), ary|
    correct_property = meta_main.options[:irregular][tag] || meta_main.options[:irregular][:default]

    values.each do |attr, content|
      ary << tag(:meta, { :content => content, correct_property => meta_property(tag, attr) }, true, false)
    end
  end.join("\n").html_safe
end

Private Instance Methods

meta_main() click to toggle source
# File lib/metas/helpers/tags.rb, line 33
def meta_main
  Metas::Main.new(controller)
end
meta_property(tag, attr) click to toggle source
# File lib/metas/helpers/tags.rb, line 29
def meta_property(tag, attr)
  "#{tag}:#{attr}"
end