Class: Yalphabetize::SequenceIndenter

Inherits:
Object
  • Object
show all
Defined in:
lib/yalphabetize/sequence_indenter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ SequenceIndenter

Returns a new instance of SequenceIndenter.



11
12
13
# File 'lib/yalphabetize/sequence_indenter.rb', line 11

def initialize(content)
  @content = content
end

Class Method Details

.call(content) ⇒ Object



7
8
9
# File 'lib/yalphabetize/sequence_indenter.rb', line 7

def self.call(content)
  new(content).call
end

Instance Method Details

#callObject



15
16
17
18
19
20
21
# File 'lib/yalphabetize/sequence_indenter.rb', line 15

def call
  return unless Yalphabetize.config['indent_sequences']

  find_lines_to_indent
  indent!
  file_lines.join
end