class Nokogiri::HTML::Document

SitemapMaker::HTML(open(“http://…”))で返されるオブジェクトです method_missingの拡張

Public Instance Methods

method_missing(method_name, args = nil, &block) click to toggle source
Calls superclass method
# File lib/SitemapMaker/Nokogiri/html.rb, line 19
def method_missing(method_name, args = nil, &block)
  method_name = method_name.to_s

  # page.meta_all などのメソッドは、xpathで要素を返す
  case  method_name
  when /_all$/
    @meta_all = self.xpath("//#{method_name.sub(/_all$/, '')}")
  else
    super
  end
end