Class: Trax::Core::PathPermutations

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Enumerable
Defined in:
lib/trax/core/path_permutations.rb

Instance Method Summary collapse

Methods included from Enumerable

#group_by_count

Constructor Details

#initialize(*args, current_path_segments: []) ⇒ PathPermutations

Returns a new instance of PathPermutations.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/trax/core/path_permutations.rb', line 6

def initialize(*args, current_path_segments:[])
  _current = args.shift
  current_path_segments << [current_path_segments.last, _current].compact

  @paths = if args.length > 0
    self.class.new(*args, current_path_segments: current_path_segments)
  else
    current_path_segments.map!{ |segs| segs.join("/") }
  end
  
  @paths
end

Instance Method Details

#__getobj__Object



19
20
21
# File 'lib/trax/core/path_permutations.rb', line 19

def __getobj__
  @paths
end