Class: ParameterSubstitution::Transform

Inherits:
Parslet::Transform
  • Object
show all
Defined in:
lib/parameter_substitution/transform.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Transform

Returns a new instance of Transform.



13
14
15
16
17
# File 'lib/parameter_substitution/transform.rb', line 13

def initialize(context)
  @context = context
  super
  define_instance_rules
end

Class Method Details

.unescape(string) ⇒ Object



73
74
75
# File 'lib/parameter_substitution/transform.rb', line 73

def self.unescape(string)
  string.to_s.gsub(/\\(.)/) { |v| v[1] }
end