Sha256: 340a71bb5e7a99b2b2a883c77841abbf486bbe6074dda7fe63a72233c7a9bd84

Contents?: true

Size: 495 Bytes

Versions: 23

Compression:

Stored size: 495 Bytes

Contents

# frozen_string_literal: true

module Phlex
  module Icons
    module Hero
      class Base < Icons::Base
        attr_reader :variant

        def initialize(variant: Phlex::Icons::Hero.configuration.default_variant, classes: nil)
          @variant = variant

          if classes
            super(classes: classes)
          else
            super()
          end
        end

        def view_template
          send(variant) if respond_to?(variant)
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
phlex-icons-0.3.0 lib/phlex/icons/hero/base.rb
phlex-icons-0.2.0 lib/phlex/icons/hero/base.rb
phlex-icons-0.1.0 lib/phlex/icons/hero/base.rb