Class: Seafoam::Formatters::Text::DescribeFormatter
- Inherits:
-
Base::DescribeFormatter
- Object
- Base::DescribeFormatter
- Seafoam::Formatters::Text::DescribeFormatter
- Defined in:
- lib/seafoam/formatters/text.rb
Overview
A plain-text formatter for the ‘describe` command.
Instance Attribute Summary
Attributes inherited from Base::DescribeFormatter
Instance Method Summary collapse
Methods inherited from Base::DescribeFormatter
Constructor Details
This class inherits a constructor from Seafoam::Formatters::Base::DescribeFormatter
Instance Method Details
#format ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/seafoam/formatters/text.rb', line 8 def format notes = Seafoam::Graal::GraphDescription::ATTRIBUTES.select { |attr| description.send(attr) } unhidden_count = graph.nodes.values.count { |n| !n.props[:hidden] } node_counts = description.sorted_node_counts.map { |node_class, count| "#{node_class}: #{count}" }.join("\n") ["#{unhidden_count} nodes", *notes].join(", ") + "\n#{node_counts}" end |