Class: Kayessess::Styleguide

Inherits:
Object
  • Object
show all
Defined in:
lib/kayessess/styleguide.rb

Overview

The Styleguide object is responsible for massaging a KSS parser object into a more useful structure for display in a UI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ Styleguide

Returns a new instance of Styleguide.



11
12
13
14
# File 'lib/kayessess/styleguide.rb', line 11

def initialize(parser)
  @parser = parser
  @tree ||= Kayessess::Tree.new(@parser.sections)
end

Instance Attribute Details

#sectionsObject

Returns the value of attribute sections.



9
10
11
# File 'lib/kayessess/styleguide.rb', line 9

def sections
  @sections
end

#treeObject

Returns the value of attribute tree.



9
10
11
# File 'lib/kayessess/styleguide.rb', line 9

def tree
  @tree
end

Instance Method Details

#root_sectionsObject



24
25
26
# File 'lib/kayessess/styleguide.rb', line 24

def root_sections
  sections.root_sections
end

#section(section) ⇒ Object



20
21
22
# File 'lib/kayessess/styleguide.rb', line 20

def section(section)
  sections.node_for_path(section.split('/'))
end

#to_partial_pathObject



28
29
30
# File 'lib/kayessess/styleguide.rb', line 28

def to_partial_path
  "styleguide"
end