Sha256: 13200a7163d5e03ca147f9730fe8ecb7088a2c6ac8338ab84e2a61fc69a37be6

Contents?: true

Size: 631 Bytes

Versions: 4

Compression:

Stored size: 631 Bytes

Contents

module Lookbook
  class PreviewGroup
    include Taggable

    attr_reader :name, :examples

    def initialize(name, preview, examples)
      @name = name
      @preview = preview
      @examples = examples
    end

    def id
      path.underscore.tr("_", "-")
    end

    def path
      "#{@preview.lookbook_path}/#{name}"
    end

    def label
      name.titleize
    end

    def type
      :group
    end

    def hidden?
      false
    end

    def matchers
      [@preview.label, label].map { |m| m.gsub(/\s/, "").downcase }
    end

    def hierarchy_depth
      @preview.lookbook_hierarchy_depth + 1
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lookbook-0.4.4 lib/lookbook/preview_group.rb
lookbook-0.4.3 lib/lookbook/preview_group.rb
lookbook-0.4.2 lib/lookbook/preview_group.rb
lookbook-0.4.1 lib/lookbook/preview_group.rb