Commit 5903b323 authored by KitaitiMakoto's avatar KitaitiMakoto

Define REXML::Element#document?, element? and text? at once

parent 33cddb09
......@@ -22,16 +22,10 @@ module EPUB
module Refinements
[REXML::Element, REXML::Text].each do |klass|
refine klass do
def document?
node_type == :document
end
def element?
node_type == :element
end
def text?
node_type == :text
%i[document element text].each do |type|
define_method "#{type}?" do
node_type == type
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment