Class: Lookbook::Component
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Entity
#<=>, #id, #label, #lookup_path, #type, #url_path
Instance Attribute Details
#component_class ⇒ Object
Returns the value of attribute component_class.
5
6
7
|
# File 'lib/lookbook/entities/component.rb', line 5
def component_class
@component_class
end
|
Instance Method Details
#inline? ⇒ Boolean
22
23
24
|
# File 'lib/lookbook/entities/component.rb', line 22
def inline?
template_file_path.present?
end
|
#name ⇒ Object
14
15
16
|
# File 'lib/lookbook/entities/component.rb', line 14
def name
component_class.name
end
|
#template_file_path ⇒ Object
18
19
20
|
# File 'lib/lookbook/entities/component.rb', line 18
def template_file_path
Dir.glob("#{directory_path}/#{file_name(true)}.*.erb").first
end
|
#template_path ⇒ Object
26
27
28
29
|
# File 'lib/lookbook/entities/component.rb', line 26
def template_path
Lookbook.logger.warn "The `template_path` method has been deprecated - use `template_file_path` instead. `template_file_path` will be removed in v2.0"
template_file_path
end
|