Module: DataBindings::WritingInterceptor
- Defined in:
- lib/data_bindings/util.rb
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &blk) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/data_bindings/util.rb', line 33 def method_missing(m, *args, &blk) if match = m.to_s.match(/^((?:force_)?convert_to_(?:[^_]+))_(.*)/) self.class.class_eval <<-EOT, __FILE__, __LINE__ + 1 def #{m}(*args, &blk) @generator.write(#{match[2].inspect}, send(#{match[1].inspect}, *args, &blk), *args, &blk) end EOT send(m, *args, &blk) else super end end |