Class: Kayessess::Styleguide
- Inherits:
-
Object
- Object
- Kayessess::Styleguide
- 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
-
#sections ⇒ Object
Returns the value of attribute sections.
-
#tree ⇒ Object
Returns the value of attribute tree.
Instance Method Summary collapse
-
#initialize(parser) ⇒ Styleguide
constructor
A new instance of Styleguide.
- #root_sections ⇒ Object
- #section(section) ⇒ Object
- #to_partial_path ⇒ Object
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
#sections ⇒ Object
Returns the value of attribute sections.
9 10 11 |
# File 'lib/kayessess/styleguide.rb', line 9 def sections @sections end |
#tree ⇒ Object
Returns the value of attribute tree.
9 10 11 |
# File 'lib/kayessess/styleguide.rb', line 9 def tree @tree end |
Instance Method Details
#root_sections ⇒ Object
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_path ⇒ Object
28 29 30 |
# File 'lib/kayessess/styleguide.rb', line 28 def to_partial_path "styleguide" end |