Sha256: 33a87a4acbf19b002fdc1260a63756253c07cd17026d6d9804524604f2efc006
Contents?: true
Size: 817 Bytes
Versions: 4
Compression:
Stored size: 817 Bytes
Contents
# frozen_string_literal: true class Scarpe class WebviewTextWidget < Scarpe::WebviewWidget end class << self def default_wv_text_widget_with(element) webview_class_name = "Webview#{element.capitalize}" webview_widget_class = Class.new(Scarpe::WebviewTextWidget) do def initialize(properties) class_name = self.class.name.split("::")[-1] @html_tag = class_name.delete_prefix("Webview").downcase super end def element HTML.render do |h| h.send(@html_tag) { @content.to_s } end end end Scarpe.const_set webview_class_name, webview_widget_class end end end Scarpe.default_wv_text_widget_with(:code) Scarpe.default_wv_text_widget_with(:em) Scarpe.default_wv_text_widget_with(:strong)
Version data entries
4 entries across 4 versions & 2 rubygems
Version | Path |
---|---|
scarpe-0.2.2 | lib/scarpe/wv/text_widget.rb |
lacci-0.2.1 | lib/scarpe/wv/text_widget.rb |
scarpe-0.2.1 | lib/scarpe/wv/text_widget.rb |
scarpe-0.2.0 | lib/scarpe/wv/text_widget.rb |