Module: Parameterised::Paths

Defined in:
lib/parameterised/paths.rb,
lib/parameterised/paths/path.rb,
lib/parameterised/paths/version.rb,
lib/parameterised/paths/path_match.rb

Defined Under Namespace

Classes: Path, PathMatch

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.path(path) ⇒ Path

Shorthand method to create a Path object

Parameters:

  • path (String)

Returns:



12
13
14
# File 'lib/parameterised/paths.rb', line 12

def self.path(path)
  Path.new(path)
end

.path_match(path, other_path) ⇒ PathMatch|nil

Attempts to match two paths together

Parameters:

  • path (String)
  • other_path (String)

Returns:

  • (PathMatch|nil)

    A PathMatch if a match is made or nil for no match



21
22
23
# File 'lib/parameterised/paths.rb', line 21

def self.path_match(path, other_path)
  Path.new(path).match(other_path)
end