Class: Nokogiri::XML::Node::XPathYielder

Inherits:
Object
  • Object
show all
Defined in:
lib/assert2/xhtml.rb

Instance Method Summary collapse

Constructor Details

#initialize(method_name, &block) ⇒ XPathYielder

Returns a new instance of XPathYielder.



66
67
68
69
70
71
# File 'lib/assert2/xhtml.rb', line 66

def initialize(method_name, &block)
  self.class.send :define_method, method_name do |*args|
    raise 'must call with block' unless block
    block.call(*args)
  end
end