Sha256: 744c591536123e18357f2df73c7ab3d0d6bba335fc8c14b42ba7748290fe572d

Contents?: true

Size: 386 Bytes

Versions: 62

Compression:

Stored size: 386 Bytes

Contents

# frozen_string_literal: true

module ViewComponent
  module WithContentHelper
    def with_content(value)
      if value.nil?
        raise ArgumentError.new(
          "No content provided to `#with_content` for #{self}.\n\n" \
          "To fix this issue, pass a value."
        )
      else
        @__vc_content_set_by_with_content = value
      end

      self
    end
  end
end

Version data entries

62 entries across 62 versions & 2 rubygems

Version Path
view_component-2.54.1 lib/view_component/with_content_helper.rb
view_component-2.54.0 lib/view_component/with_content_helper.rb
view_component-2.53.0 lib/view_component/with_content_helper.rb
view_component-2.52.0 lib/view_component/with_content_helper.rb
view_component-2.51.0 lib/view_component/with_content_helper.rb
view_component-2.50.0 lib/view_component/with_content_helper.rb
view_component-2.49.1 lib/view_component/with_content_helper.rb
view_component-2.49.0 lib/view_component/with_content_helper.rb
view_component-2.48.0 lib/view_component/with_content_helper.rb
view_component-2.47.0 lib/view_component/with_content_helper.rb
view_component-2.46.0 lib/view_component/with_content_helper.rb
view_component-2.45.0 lib/view_component/with_content_helper.rb
view_component-2.44.0 lib/view_component/with_content_helper.rb
view_component-2.43.1 lib/view_component/with_content_helper.rb
view_component-2.43.0 lib/view_component/with_content_helper.rb
view_component-2.42.0 lib/view_component/with_content_helper.rb
view_component-2.41.0 lib/view_component/with_content_helper.rb
view_component-2.40.0 lib/view_component/with_content_helper.rb
view_component-2.39.0 lib/view_component/with_content_helper.rb
view_component-2.38.0 lib/view_component/with_content_helper.rb