Class: HamlLint::RubyExtraction::AdHocChunk
- Defined in:
- lib/haml_lint/ruby_extraction/ad_hoc_chunk.rb
Overview
This chunk just adds its code to the ruby, but does not attempt to transfer their correction in any way.
Used for piece of code that just need to be in the generated ruby for reasons specific to the use cases, such as needing a ‘begin` to do add indentation.
Constant Summary
Constants inherited from BaseChunk
BaseChunk::COMMA_CHANGES_LINES
Instance Attribute Summary
Attributes inherited from BaseChunk
#end_marker_indent, #haml_line_index, #node, #ruby_lines, #start_marker_line_number
Instance Method Summary collapse
-
#initialize(*args, **kwargs) ⇒ AdHocChunk
constructor
A new instance of AdHocChunk.
- #skip_line_indexes_in_source_map ⇒ Object
- #transfer_correction(coordinator, all_corrected_ruby_lines, haml_lines) ⇒ Object
- #wrap_in_markers ⇒ Object
Methods inherited from BaseChunk
#assemble_in, #full_assemble, #fuse, #haml_end_line_index, #nb_haml_lines, #start_marker_indent, #transfer_correction_logic
Constructor Details
#initialize(*args, **kwargs) ⇒ AdHocChunk
Returns a new instance of AdHocChunk.
10 11 12 |
# File 'lib/haml_lint/ruby_extraction/ad_hoc_chunk.rb', line 10 def initialize(*args, **kwargs) super(*args, **kwargs.merge(end_marker_indent: nil)) end |
Instance Method Details
#skip_line_indexes_in_source_map ⇒ Object
20 21 22 |
# File 'lib/haml_lint/ruby_extraction/ad_hoc_chunk.rb', line 20 def skip_line_indexes_in_source_map (0...@ruby_lines.size).to_a end |
#transfer_correction(coordinator, all_corrected_ruby_lines, haml_lines) ⇒ Object
18 |
# File 'lib/haml_lint/ruby_extraction/ad_hoc_chunk.rb', line 18 def transfer_correction(coordinator, all_corrected_ruby_lines, haml_lines); end |
#wrap_in_markers ⇒ Object
14 15 16 |
# File 'lib/haml_lint/ruby_extraction/ad_hoc_chunk.rb', line 14 def wrap_in_markers false end |