Sha256: 3394a87fea18f68e164e6554df71f67f5415c7899fa5b52b722e0d6405e49535
Contents?: true
Size: 976 Bytes
Versions: 12
Compression:
Stored size: 976 Bytes
Contents
require 'delegate' module Coprl module Presenters module WebClient class ComponentHtmlDecorator < SimpleDelegator def _plugins_ __getobj__.send(:_plugins_) end def method_missing(meth, *args, &block) if respond_to?(meth) super else nil end end private HTML_ESCAPED_ATTRIBUTES = %i( id type ) def self.html_escape_attribute(attr) define_method(attr) do self.class.html_escape(super()) end end HTML_ESCAPED_ATTRIBUTES.each do |attr| html_escape_attribute(attr) end def self.inherited(subclass) subclass::HTML_ESCAPED_ATTRIBUTES.each do |attr| html_escape_attribute(attr) end end def self.html_escape(text) Rack::Utils.escape_html(text) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems