Class: Jade::Frontend::CommentAttacher::CommentGroup
- Inherits:
-
Data
- Object
- Data
- Jade::Frontend::CommentAttacher::CommentGroup
- Defined in:
- lib/jade/frontend/comment_attacher.rb
Class Method Summary collapse
Class Method Details
.from_comments(entries) ⇒ Object
121 122 123 124 125 126 127 128 |
# File 'lib/jade/frontend/comment_attacher.rb', line 121 def self.from_comments(entries) by_type = entries.group_by(&:class) new( leading: (by_type[CommentEntry::Leading] || []).map(&:comment), trailing: (by_type[CommentEntry::Trailing] || []).map(&:comment), dangling: (by_type[CommentEntry::Dangling] || []).map(&:comment), ) end |