Class: ClassMetrix::Formatters::Components::GenericHeaderComponent
- Inherits:
-
Base::BaseComponent
- Object
- Base::BaseComponent
- ClassMetrix::Formatters::Components::GenericHeaderComponent
- Defined in:
- lib/class_metrix/formatters/components/generic_header_component.rb
Instance Attribute Summary
Attributes inherited from Base::BaseComponent
#data, #options, #value_processor
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(data, options = {}) ⇒ GenericHeaderComponent
constructor
A new instance of GenericHeaderComponent.
Constructor Details
#initialize(data, options = {}) ⇒ GenericHeaderComponent
Returns a new instance of GenericHeaderComponent.
9 10 11 12 13 14 15 |
# File 'lib/class_metrix/formatters/components/generic_header_component.rb', line 9 def initialize(data, = {}) super @format = .fetch(:format, :markdown) @title = [:title] @extraction_types = [:extraction_types] || [] @show_metadata = .fetch(:show_metadata, true) end |
Instance Method Details
#generate ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/class_metrix/formatters/components/generic_header_component.rb', line 17 def generate return [] unless @show_metadata case @format when :markdown generate_markdown_header when :csv generate_csv_header else raise ArgumentError, "Unknown format: #{@format}" end end |