Sha256: a861585d85074c9b6d0c95cf5cd1de8ae624d094ff72c81e788a5e196d45b857

Contents?: true

Size: 677 Bytes

Versions: 2

Compression:

Stored size: 677 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("/", "-").tr("_", "-")
    end

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

    def label
      name.titleize
    end

    def type
      :group
    end

    def params
      []
    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

2 entries across 2 versions & 1 rubygems

Version Path
lookbook-0.4.6 lib/lookbook/preview_group.rb
lookbook-0.4.5 lib/lookbook/preview_group.rb