Sha256: 3ef4f91dc28ab24aa902ececfa6af4ca394aca220f6fa5ec8b8f1aecb60a7d88

Contents?: true

Size: 435 Bytes

Versions: 17

Compression:

Stored size: 435 Bytes

Contents

module Coco
  class Link < Coco::Component
    include Concerns::Extendable
    include Concerns::ActsAsLink
    include Concerns::WithIcon

    after_initialize do
      get_option(:icon, :position).default = "start"
    end

    def call
      render component_tag(class: "coco-link") do
        safe_join([
          icon,
          icon? ? tag.span(link_text, class: "link-text") : link_text
        ])
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
coveragebook_components-0.7.2 app/components/coco/base/link/link.rb
coveragebook_components-0.7.1 app/components/coco/base/link/link.rb
coveragebook_components-0.7.0 app/components/coco/base/link/link.rb
coveragebook_components-0.6.5 app/components/coco/base/link/link.rb
coveragebook_components-0.6.4 app/components/coco/base/link/link.rb
coveragebook_components-0.6.3 app/components/coco/base/link/link.rb
coveragebook_components-0.6.2 app/components/coco/base/link/link.rb
coveragebook_components-0.6.1 app/components/coco/base/link/link.rb
coveragebook_components-0.6.0 app/components/coco/base/link/link.rb
coveragebook_components-0.5.7 app/components/coco/base/link/link.rb
coveragebook_components-0.5.6 app/components/coco/base/link/link.rb
coveragebook_components-0.5.5 app/components/coco/base/link/link.rb
coveragebook_components-0.5.4 app/components/coco/base/link/link.rb
coveragebook_components-0.5.3 app/components/coco/base/link/link.rb
coveragebook_components-0.5.2 app/components/coco/base/link/link.rb
coveragebook_components-0.5.1 app/components/coco/base/link/link.rb
coveragebook_components-0.5.0 app/components/coco/base/link/link.rb