Class: Stylesheet
- Inherits:
-
Object
- Object
- Stylesheet
- Defined in:
- app/models/stylesheet.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Stylesheet
constructor
A new instance of Stylesheet.
- #parse ⇒ Object
Constructor Details
#initialize(options) ⇒ Stylesheet
Returns a new instance of Stylesheet.
2 3 4 5 |
# File 'app/models/stylesheet.rb', line 2 def initialize() @file_path = [:file_path] @css = [:css] end |
Instance Method Details
#parse ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/stylesheet.rb', line 7 def parse documentation = [] styleguide_comments.each do |comment| comment = comment[1] name = find_name_for(comment) section = find_section_for(comment) description = find_description_for(comment) example = find_example_for(comment) url = find_url_for(comment) if name.present? || section.present? || description.present? || example.present? || url.present? component = Component.new component.source = @file_path component.name = name if name if section component.section = section else component.section = name end component.description = description if description component.example = example if example component.url = url if url documentation << component end end group_by_section(documentation) end |