Sha256: 986eca05fe992dc60fe03d7ea35135bea08497e63b9bc7c9921c6be9899d05be

Contents?: true

Size: 367 Bytes

Versions: 20

Compression:

Stored size: 367 Bytes

Contents

module Coco
  class Avatar < Coco::Component
    include Concerns::AcceptsOptions

    accepts_option :size, from: %i[sm md lg xl], default: :md

    attr_reader :src, :name

    def initialize(src:, name: nil, **)
      @src = src
      @name = name
    end

    def call
      render component_tag do
        tag.img src: src, alt: name
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
coveragebook_components-0.11.0 app/components/coco/shared/avatar/avatar.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/shared/avatar/avatar.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/shared/avatar/avatar.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/shared/avatar/avatar.rb
coveragebook_components-0.10.0 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.9.1 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.9.0 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.9 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.8 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.7 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.6 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.5 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.4 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.3 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.2 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.1 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.0 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.0.beta.3 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.0.beta.2 app/components/coco/base/avatar/avatar.rb
coveragebook_components-0.8.0.beta.1 app/components/coco/base/avatar/avatar.rb