Method: FileSource::Component#initialize
- Defined in:
- app/components/lookbook/file_source/component.rb
#initialize(file_path:, source: nil, highlight_lines: [], lines_around_highlight: nil, start_line: 1, end_line: nil, start_line_number: nil, **html_attrs) ⇒ Component
Returns a new instance of Component.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/components/lookbook/file_source/component.rb', line 5 def initialize(file_path:, source: nil, highlight_lines: [], lines_around_highlight: nil, start_line: 1, end_line: nil, start_line_number: nil, **html_attrs) @file_path = file_path @source = source @highlight_lines = highlight_lines.map(&:to_i) @start_line = start_line @end_line = end_line @start_line_number = start_line_number @lines_around_highlight = lines_around_highlight super(**html_attrs) end |