lib/lookbook/preview_group.rb in lookbook-0.6.1 vs lib/lookbook/preview_group.rb in lookbook-0.7.0
- old
+ new
@@ -1,23 +1,23 @@
module Lookbook
class PreviewGroup
- include Taggable
+ include Utils
- attr_reader :name, :examples
+ attr_reader :name, :examples, :preview
def initialize(name, preview, examples)
@name = name
@preview = preview
@examples = examples
end
def id
- path.underscore.tr("/", "-").tr("_", "-")
+ generate_id(lookup_path)
end
def path
- "#{@preview.lookbook_path}/#{name}"
+ "#{@preview.path}/#{name}"
end
def label
name.titleize
end
@@ -36,14 +36,20 @@
def hidden?
false
end
+ def position
+ 10000
+ end
+
def matchers
- [@preview.label, label].map { |m| m.gsub(/\s/, "").downcase }
+ normalize_matchers(@preview.label, label)
end
def hierarchy_depth
- @preview.lookbook_hierarchy_depth + 1
+ @preview.hierarchy_depth + 1
end
+
+ alias_method :lookup_path, :path
end
end