Class: Relocator::Path::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/relocator/path/spec.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Spec

Returns a new instance of Spec.



6
7
8
# File 'lib/relocator/path/spec.rb', line 6

def initialize(string)
  self.string = string
end

Class Method Details

.call(*args) ⇒ Object



2
3
4
# File 'lib/relocator/path/spec.rb', line 2

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



10
11
12
13
14
15
# File 'lib/relocator/path/spec.rb', line 10

def call
  string
    .split("/")
    .yield_self(&replace)
    .join("/")
end