Class: Lookbook::PreviewGroup
- Inherits:
-
Object
- Object
- Lookbook::PreviewGroup
show all
- Includes:
- Taggable
- Defined in:
- lib/lookbook/preview_group.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Taggable
#code_object, #lookbook_group, #lookbook_hidden?, #lookbook_label, #lookbook_notes
Constructor Details
#initialize(name, preview, examples) ⇒ PreviewGroup
7
8
9
10
11
|
# File 'lib/lookbook/preview_group.rb', line 7
def initialize(name, preview, examples)
@name = name
@preview = preview
@examples = examples
end
|
Instance Attribute Details
#examples ⇒ Object
Returns the value of attribute examples.
5
6
7
|
# File 'lib/lookbook/preview_group.rb', line 5
def examples
@examples
end
|
#name ⇒ Object
Returns the value of attribute name.
5
6
7
|
# File 'lib/lookbook/preview_group.rb', line 5
def name
@name
end
|
Instance Method Details
#hierarchy_depth ⇒ Object
33
34
35
|
# File 'lib/lookbook/preview_group.rb', line 33
def hierarchy_depth
@preview.lookbook_hierarchy_depth + 1
end
|
#id ⇒ Object
13
14
15
|
# File 'lib/lookbook/preview_group.rb', line 13
def id
path.underscore.tr("_", "-")
end
|
#label ⇒ Object
21
22
23
|
# File 'lib/lookbook/preview_group.rb', line 21
def label
name.titleize
end
|
#matchers ⇒ Object
29
30
31
|
# File 'lib/lookbook/preview_group.rb', line 29
def matchers
[@preview.label, label].map { |m| m.gsub(/\s/, "").downcase }
end
|
#path ⇒ Object
17
18
19
|
# File 'lib/lookbook/preview_group.rb', line 17
def path
"#{@preview.lookbook_path}/#{name}"
end
|
#type ⇒ Object
25
26
27
|
# File 'lib/lookbook/preview_group.rb', line 25
def type
:group
end
|