Sha256: 23cf661cbb523da411142cdbbe806d3134f25f3e6657cf9d2c41e68207fa76a6
Contents?: true
Size: 542 Bytes
Versions: 9
Compression:
Stored size: 542 Bytes
Contents
module BetterHtml class NodeIterator class Base def self.tokenized_attribute(name) class_eval <<~RUBY attr_reader :#{name}_parts def #{name} #{name}_parts.map(&:text).join end RUBY end def node_type self.class.name.split('::').last.downcase.to_sym end %w(text cdata comment element).each do |name| class_eval <<~RUBY def #{name}? node_type == :#{name} end RUBY end end end end
Version data entries
9 entries across 9 versions & 1 rubygems