Class: Creamerscript::Sweeteners::JSArgumentList
- Defined in:
- lib/creamerscript/sweeteners/js_argument_list.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#call, #initialize, #to_coffee, #token, #tokenize, #type
Constructor Details
This class inherits a constructor from Creamerscript::Sweeteners::Base
Instance Method Details
#pattern ⇒ Object
8 9 10 |
# File 'lib/creamerscript/sweeteners/js_argument_list.rb', line 8 def pattern /\(#{SYMBOL} #{SYMBOL}:(#{SYMBOL},\s*[#{SYMBOL},\s]*)\)/ end |
#substitute(source) ⇒ Object
4 5 6 |
# File 'lib/creamerscript/sweeteners/js_argument_list.rb', line 4 def substitute(source) source.gsub!(pattern) { |match| match.gsub($1, tokenize($1)) } end |