Sha256: 37c09bb1a974543ebc4ef8b00ead8b2cb2ecfb34b2938bb89d1855aa33b97aae
Contents?: true
Size: 972 Bytes
Versions: 4
Compression:
Stored size: 972 Bytes
Contents
module Lookbook class PreviewGroup < Entity attr_reader :name, :examples, :preview def initialize(name, preview, examples) @name = name @preview = preview @examples = examples super("#{@preview.path}/#{name}") end def url_path lookbook_inspect_path lookup_path end def label name.titleize end def type :group end def display_options merged = {} examples.reverse.map do |example| merged.merge! example.display_options end merged end def hidden? false end def position 10000 end def matchers normalize_matchers(@preview.label, label) end def hierarchy_depth @preview.hierarchy_depth + 1 end def tags(name = nil) examples.map { |example| example.tags(name) }.flatten end def tag(name = nil) tags(name).first end alias_method :lookup_path, :path end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
lookbook-1.3.4 | lib/lookbook/preview_group.rb |
lookbook-1.3.3 | lib/lookbook/preview_group.rb |
lookbook-1.3.1 | lib/lookbook/preview_group.rb |
lookbook-1.3.0 | lib/lookbook/preview_group.rb |