Sha256: 55b9984804423d62e15cb50a52f4b4f79260e238281fbcc2cb66dbc84695bc30

Contents?: true

Size: 835 Bytes

Versions: 7

Compression:

Stored size: 835 Bytes

Contents

module Coco
  module BaseHelper
    def coco_tag(*args, **kwargs, &block)
      render Coco::Tag.new(*args, **kwargs), &block
    end

    def coco_svg(path = nil, **kwargs)
      render Coco::Svg.new(path: path, **kwargs)
    end

    def coco_image(src = nil, **kwargs)
      render Coco::Image.new(src: src, **kwargs)
    end

    def coco_icon(icon_name = nil, **kwargs, &block)
      render Coco::Icon.new(name: icon_name, **kwargs), &block
    end

    def coco_embed(platform, url = nil, **kwargs)
      case platform
      when :youtube
        render Coco::Embeds::Youtube.new(url: url, **kwargs)
      else
        raise ArgumentError, "`#{platform}` is not a valid embed type"
      end
    end

    def coco_placeholder(*args, **kwargs, &block)
      render Coco::Placeholder.new(*args, **kwargs), &block
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
coveragebook_components-0.6.5 app/helpers/coco/base_helper.rb
coveragebook_components-0.6.4 app/helpers/coco/base_helper.rb
coveragebook_components-0.6.3 app/helpers/coco/base_helper.rb
coveragebook_components-0.6.2 app/helpers/coco/base_helper.rb
coveragebook_components-0.6.1 app/helpers/coco/base_helper.rb
coveragebook_components-0.6.0 app/helpers/coco/base_helper.rb
coveragebook_components-0.5.7 app/helpers/coco/base_helper.rb