Sha256: 20f16cc43177667bf20afabdfd8cf5282c1343661ac41df48948fb5649d2964a

Contents?: true

Size: 484 Bytes

Versions: 21

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

module UiBibz::Ui::Concerns::HtmlConcern #:nodoc:
  extend ActiveSupport::Concern

  included do
    def html(content = nil, &block)
      if block.nil?
        @items << RenderString.new(content)
      else
        context = eval('self', block.binding) # rubocop:disable Style/EvalWithLocation
        @items << RenderString.new(context.capture(&block))
      end
    end
  end
end

class RenderString < SimpleDelegator
  def render
    self
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ui_bibz-3.0.0 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta19 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta18 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta17 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta16 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta15 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta14 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta13 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta12 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta11 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta10 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta9 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta8 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta7 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta6 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta5 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta4 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta3 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta2 lib/ui_bibz/ui/concerns/html_concern.rb
ui_bibz-3.0.0.beta1 lib/ui_bibz/ui/concerns/html_concern.rb