Sha256: 634064185ccea0b687152f5d31f5cf219a6d7fb8ca1605b4408ee0bb4fd86dc4

Contents?: true

Size: 782 Bytes

Versions: 15

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbHashtag
    class Hashtag
      include Playbook::Props

      partial "pb_hashtag/hashtag"

      prop :text
      prop :dark, type: Playbook::Props::Boolean, default: false
      prop :type, type: Playbook::Props::Enum,
                  values: %w[default project home],
                  default: "default"
      prop :url

      def classname
        generate_classname("pb_hastag_kit", dark_class)
      end

      def hashtag_text
        type_text + text
      end

    private

      def dark_class
        dark ? "dark" : nil
      end

      def type_text
        if type === "home"
          "H#"
        elsif type === "project"
          "P#"
        else
          "#"
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
playbook_ui-4.2.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-4.1.2 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-4.1.1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-4.1.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-4.0.1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-4.0.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.5.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.4.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.3.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.2.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.1.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.0.1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-3.0.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-2.9.9 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-2.9.8 app/pb_kits/playbook/pb_hashtag/hashtag.rb