Class: Trax::Core::PathPermutations
- Includes:
- Enumerable
- Defined in:
- lib/trax/core/path_permutations.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(*args, current_path_segments: []) ⇒ PathPermutations
constructor
A new instance of PathPermutations.
Methods included from Enumerable
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 |