Class: Kayessess::Section
- Inherits:
-
Node
- Object
- Node
- Kayessess::Section
show all
- Defined in:
- lib/kayessess/section.rb
Overview
A wrapper around KSS section object
Instance Attribute Summary
Attributes inherited from Node
#children_hash, #id, #name, #parent, #sections_hash
Instance Method Summary
collapse
Methods inherited from Node
#children, #parents, #sections, #to_param, #to_path
Constructor Details
#initialize(id, name, parent, section) ⇒ Section
Returns a new instance of Section.
8
9
10
11
12
|
# File 'lib/kayessess/section.rb', line 8
def initialize(id, name, parent, section)
super(id, name, parent)
@section = section
end
|
Instance Method Details
#description ⇒ Object
18
19
20
|
# File 'lib/kayessess/section.rb', line 18
def description
@description ||= Kayessess.markdownerize(@section.description)
end
|
#example_partial_path ⇒ Object
35
36
37
38
|
# File 'lib/kayessess/section.rb', line 35
def example_partial_path
reference_path = reference.split('.').map {|s| s.parameterize('_')}
"styleguide/examples/#{File.join(reference_path)}"
end
|
#filename ⇒ Object
31
32
33
|
# File 'lib/kayessess/section.rb', line 31
def filename
@section.filename
end
|
#is_section? ⇒ Boolean
44
45
46
|
# File 'lib/kayessess/section.rb', line 44
def is_section?
true
end
|
#modifiers ⇒ Object
22
23
24
25
26
27
28
29
|
# File 'lib/kayessess/section.rb', line 22
def modifiers
@modifiers ||= @section.modifiers.map {|modifier|
if modifier.description
modifier.description = Kayessess.markdownerize(modifier.description)
end
modifier
}
end
|
#reference ⇒ Object
14
15
16
|
# File 'lib/kayessess/section.rb', line 14
def reference
@section.section
end
|
#to_partial_path ⇒ Object
40
41
42
|
# File 'lib/kayessess/section.rb', line 40
def to_partial_path
"section"
end
|