Class: ConfigTemplates::Criteria::Path
- Inherits:
-
Object
- Object
- ConfigTemplates::Criteria::Path
- Defined in:
- lib/config_templates/criteria/path.rb
Instance Method Summary collapse
- #filter(hash) ⇒ Object
-
#initialize(path, relative_to) ⇒ Path
constructor
A new instance of Path.
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 |