Class: Hashira::Duplication::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/duplication/sequence.rb

Constant Summary collapse

MIN_STATEMENTS =
1
MAX_STATEMENTS =
12
LIST_RUN =
3

Instance Method Summary collapse

Constructor Details

#initialize(file, statements) ⇒ Sequence

Returns a new instance of Sequence.



10
11
12
13
# File 'lib/hashira/duplication/sequence.rb', line 10

def initialize(file, statements)
  @file = file
  @statements = statements
end

Instance Method Details

#fragmentsObject



15
16
17
18
19
# File 'lib/hashira/duplication/sequence.rb', line 15

def fragments
  return [] if listing?

  lengths.flat_map { |length| slide(length) }
end