Class: ConfigTemplates::Criteria::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/config_templates/criteria/path.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, relative_to) ⇒ Path

Returns a new instance of Path.



3
4
5
6
# File 'lib/config_templates/criteria/path.rb', line 3

def initialize(path, relative_to)
  @path = path
  @relative_to = relative_to
end

Instance Method Details

#filter(hash) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/config_templates/criteria/path.rb', line 8

def filter(hash)
  if @path.start_with? '@'
    with_absolute_path hash
  else
    with_relative_path hash
  end
end